66 394
contributi
mNessun oggetto della modifica |
(Item added to References) |
||
(17 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 396: | Riga 396: | ||
else | else | ||
for _, Statement in pairs(Statements) do | for _, Statement in pairs(Statements) do | ||
local | local ReferenceItem = Statement.mainsnak.datavalue.value.id | ||
local Reference = mw.wikibase.getSitelink(ReferenceItem) | |||
if not Reference then | if not Reference then | ||
Reference = Statement.mainsnak.datavalue.value.id | --Reference = Statement.mainsnak.datavalue.value.id | ||
AllReferences[#AllReferences + 1] = "* [[Special:AboutTopic/" .. | AllReferences[#AllReferences + 1] = "* [[Special:AboutTopic/" .. ReferenceItem .. "]] - " .. ReferenceItem | ||
else | else | ||
if frame.args['AddSemantic'] then | if frame.args['AddSemantic'] then | ||
Reference = "Riferimento::" .. Reference | |||
end | |||
AllReferences[#AllReferences + 1] = "* [[" .. Reference .. "]] - " .. ReferenceItem | |||
end | end | ||
end | end | ||
Riga 416: | Riga 417: | ||
function p.ListBackReferences(frame) | function p.ListBackReferences(frame) | ||
-- See example here https://github.com/SemanticMediaWiki/SemanticScribunto/blob/master/docs/mw.smw.getQueryResult.md | -- See example here https://github.com/SemanticMediaWiki/SemanticScribunto/blob/master/docs/mw.smw.getQueryResult.md | ||
-- See also here https://doc.semantic-mediawiki.org/md_content_extensions_SemanticScribunto_docs_mw_8smw_8getQueryResult.html | |||
local AllBackReferences = {} | local AllBackReferences = {} | ||
--[=[ | --[=[ | ||
Riga 459: | Riga 461: | ||
Row = "[[" .. v.fulltext .. "]]" | Row = "[[" .. v.fulltext .. "]]" | ||
end | end | ||
Row = Row .. v.printouts['DataTrek ID'] | if v.printouts['DataTrek ID'][1] ~= nil then | ||
Row = Row .. " - " .. v.printouts['DataTrek ID'][1] | |||
end | |||
AllBackReferences[#AllBackReferences + 1] = "*" .. Row | AllBackReferences[#AllBackReferences + 1] = "*" .. Row | ||
end | end | ||
Riga 469: | Riga 474: | ||
return queryResult | return queryResult | ||
end | end | ||
return p | return p |