66 379
contributi
(Link format) |
(Item added to References) |
||
(20 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 457: | Riga 459: | ||
Row = "[[:" .. v.fulltext .. "]]" --string.sub(v.fulltext, 3) | Row = "[[:" .. v.fulltext .. "]]" --string.sub(v.fulltext, 3) | ||
else | else | ||
Row = "[[" .. v.fulltext "]]" | Row = "[[" .. v.fulltext .. "]]" | ||
end | |||
if v.printouts['DataTrek ID'][1] ~= nil then | |||
Row = Row .. " - " .. v.printouts['DataTrek ID'][1] | |||
end | end | ||
AllBackReferences[#AllBackReferences + 1] = "*" .. Row | AllBackReferences[#AllBackReferences + 1] = "*" .. Row | ||
end | end | ||
Riga 468: | Riga 474: | ||
return queryResult | return queryResult | ||
end | end | ||
return p | return p |