66 647
contributi
Nessun oggetto della modifica |
(Implemented generic "PropertyList") |
||
Riga 319: | Riga 319: | ||
Label = WTLink | Label = WTLink | ||
end | end | ||
if string.find(WTLink, "Categoria:", 1, true) ~= nil | if string.find(WTLink, "Categoria:", 1, true) ~= nil then | ||
return "[[" .. WTLink .. "]]" | return "[[" .. WTLink .. "]]" | ||
elseif AddSemantic then | elseif AddSemantic then | ||
Riga 481: | Riga 481: | ||
--- Writes a gneric UL list from property, adding SMW link if specified | --- Writes a gneric UL list from property, adding SMW link if specified | ||
-- | -- | ||
-- @PName Info from MW session | -- @param PName Info from MW session | ||
-- @SMWPrefix | -- @param SMWPrefix | ||
-- @return A bullet list of backlinks | -- @return A bullet list of backlinks | ||
function p.PropertyList(frame) | function p.PropertyList(frame) | ||
Riga 496: | Riga 496: | ||
return "Nessun riferimento trovato" | return "Nessun riferimento trovato" | ||
elseif table.getn(Statements) == 1 then | elseif table.getn(Statements) == 1 then | ||
return Statements[1].mainsnak.datavalue.value.id | return p.LabelOrLink(Statements[1].mainsnak.datavalue.value.id, frame.args["SMWPrefix"], true) | ||
else | else | ||
for _, Statement in pairs(Statements) do | for _, Statement in pairs(Statements) do | ||
--local ReferenceItem = Statement.mainsnak.datavalue.value.id | --local ReferenceItem = Statement.mainsnak.datavalue.value.id | ||
AllReferences[#AllReferences + 1] = "<li> | AllReferences[#AllReferences + 1] = "<li>" .. p.LabelOrLink(Statement.mainsnak.datavalue.value.id, frame.args["SMWPrefix"], true) .. "</li>" | ||
end | end | ||
return "<ul>" .. table.concat(AllReferences, string.char(10)) .. "</ul>" | return "<ul>" .. table.concat(AllReferences, string.char(10)) .. "</ul>" |