Modulo:Wikidata: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
+p._subclassOf() con refactoring di p._instanceOf() |
aggiorno funzione getId |
||
Riga 709:
end
-- Ritorna l'ID dell'item Wikidata collegato alla pagina corrente o a una pagina specificata.
local function
local title = mw.title.new(titleString)
return mw.wikibase.getEntityIdForCurrentPage()▼
while title do
local id = mw.wikibase.getEntityIdForTitle(title.prefixedText)
if id then
end▼
title = title.redirectTarget
end
return nil
end
function p.getId( frame )▼
local args = (frame.args[1] and frame.args) or (frame:getParent() and frame:getParent().args) or {}
if not args[1] then
end
for _, titleString in ipairs(args) do
local id = getIdFromTitle(titleString)
if id then
return id
end
end
return nil
end
Riga 767 ⟶ 791:
return select(2, xpcall(function()
return p._getDatatype(getArgs(frame, {parentOnly = true}))
▲end
▲function p.getId(frame)
▲ return p._getId()
end, errhandler))
end
|