66 538
contributi
(First version) |
(ListAppearances protorype) |
||
Riga 33: | Riga 33: | ||
-- 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 | -- See also here https://doc.semantic-mediawiki.org/md_content_extensions_SemanticScribunto_docs_mw_8smw_8getQueryResult.html | ||
local | local AllAppearances = {} | ||
--[=[ | --[=[ | ||
local QueryResult = mw.smw.ask('[[Riferimento::' .. mw.title.getCurrentTitle().text .. ']]|?DataTrek ID|format=broadtable') | local QueryResult = mw.smw.ask('[[Riferimento::' .. mw.title.getCurrentTitle().text .. ']]|?DataTrek ID|format=broadtable') | ||
Riga 58: | Riga 58: | ||
--local queryResult = mw.smw.getQueryResult( frame.args ) | --local queryResult = mw.smw.getQueryResult( frame.args ) | ||
--local QueryResult = mw.smw.getQueryResult('[[Interprete::' .. mw.title.getCurrentTitle().text .. ']]|?DataTrek ID') | --local QueryResult = mw.smw.getQueryResult('[[Interprete::' .. mw.title.getCurrentTitle().text .. ']]|?DataTrek ID') | ||
local QueryResult = mw.smw.getQueryResult('[[Riferimento::' .. | local Actor = mw.title.getCurrentTitle().text | ||
local QueryResult = mw.smw.getQueryResult('[[Riferimento::' .. Actor .. ']]|?' .. Actor) | |||
if QueryResult == nil then | if QueryResult == nil then | ||
Riga 72: | Riga 73: | ||
myResult = myResult .. k .. " | no page title for result set available (you probably specified ''mainlabel=-')" | myResult = myResult .. k .. " | no page title for result set available (you probably specified ''mainlabel=-')" | ||
end]=] | end]=] | ||
--[=[ | |||
if string.sub(v.fulltext, 1, 5) == "File:" then | if string.sub(v.fulltext, 1, 5) == "File:" then | ||
Row = "[[:" .. v.fulltext .. "]]" --string.sub(v.fulltext, 3) | Row = "[[:" .. v.fulltext .. "]]" --string.sub(v.fulltext, 3) | ||
Riga 80: | Riga 82: | ||
Row = Row .. " - " .. v.printouts['DataTrek ID'][1] | Row = Row .. " - " .. v.printouts['DataTrek ID'][1] | ||
end | end | ||
]=] | |||
Row = k .. " - " .. v | |||
AllAppearances[#AllAppearances + 1] = "*" .. Row | |||
end | end | ||
return table.concat( | return table.concat(AllAppearances, string.char(10)) | ||
else | else | ||
return "''No table''" | return "''No table''" |