66 528
contributi
(Function SemanticToEntity created) |
mNessun oggetto della modifica |
||
(4 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 214: | Riga 214: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
function p.SemanticToEntity(frame) | function p.SemanticToEntity(frame) | ||
mw.smw.set("DataTrek ID = " .. mw.wikibase.getEntityIdForCurrentPage()) | if mw.wikibase.getEntity() ~= nil then | ||
mw.smw.set("DataTrek ID = " .. mw.wikibase.getEntityIdForCurrentPage()) | |||
end | |||
end | |||
-------------------------------------------------------------------------------- | |||
-- Set the semantic property for the linked DataTrek entity on the current page | |||
-- to be used as a plain text string | |||
-- | |||
-- @param frame The frame of the page | |||
-------------------------------------------------------------------------------- | |||
function p.SemanticToItem(frame) | |||
if mw.wikibase.getEntity() ~= nil then | |||
mw.smw.set("DataTrek Item = " .. mw.wikibase.getEntityIdForCurrentPage()) | |||
end | |||
end | end | ||
function p.LabelByLang(frame) | function p.LabelByLang(frame) | ||
local Item = mw.wikibase.getEntityIdForCurrentPage() | local Item = mw.wikibase.getEntityIdForCurrentPage() | ||
Riga 534: | Riga 546: | ||
AllBackReferences[#AllBackReferences + 1] = "*" .. Row | AllBackReferences[#AllBackReferences + 1] = "*" .. Row | ||
end | end | ||
ResultText = table.concat(AllBackReferences, string.char(10)) | |||
ResultText = "<div style='column-count:3;-moz-column-count:3;-webkit-column-count:3'>" .. string.char(10) .. ResultText .. string.char(10) .. "</div>" | |||
if not (ImagesList == nil or ImagesList == "") then | |||
ResultText = ResultText .. string.char(10) .. "=== Immagini collegate ===" .. string.char(10) .. frame:extensionTag( "gallery", ImagesList) | |||
end | |||
return ResultText --table.concat(AllBackReferences, string.char(10)) | |||
else | else | ||
return "''No table''" | return "''No table''" |