„Modul:Wikibase“ – Versionsunterschied
Erscheinungsbild
[ungesichtete Version] | [gesichtete Version] |
Inhalt gelöscht Inhalt hinzugefügt
Keine Bearbeitungszusammenfassung Markierung: Zurückgesetzt |
Markierung: Rückgängigmachung |
||
Zeile 3: | Zeile 3: | ||
function p.EntityIdForTitle(frame) |
function p.EntityIdForTitle(frame) |
||
return mw.wikibase.getEntityIdForTitle( frame.args[1] ) |
return mw.wikibase.getEntityIdForTitle( frame.args[1] ) |
||
end |
|||
function p.struc(frame) |
|||
local function try() |
|||
local i, e = 1, mw.wikibase.getEntity(); |
|||
while frame.args[i] do |
|||
e = e[ frame.args[ i ] ] or e[ tonumber( frame.args[ i ] ) ]; |
|||
i = i + 1 |
|||
end |
|||
return tabletostr( e, frame.args[ 'f' ], frame.args[ 's' ] or '; ', '{', '}' ) |
|||
end |
|||
local r, result = pcall( try ); |
|||
if r then |
|||
return result; |
|||
else |
|||
return '<strong class="error">Error</strong>'; |
|||
end |
|||
end |
end |
||