Anonimo

Modulo:DTSpecific: differenze tra le versioni

Da Wikitrek.
ListAppearances protorype
(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 AllBackReferences = {}
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::' .. mw.title.getCurrentTitle().text .. ']]|?' .. mw.title.getCurrentTitle().text)
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
            ]=]
              
              
AllBackReferences[#AllBackReferences + 1] = "*" .. Row
            Row = k .. " -  " .. v
AllAppearances[#AllAppearances + 1] = "*" .. Row
         end
         end
         return table.concat(AllBackReferences, string.char(10))
         return table.concat(AllAppearances, string.char(10))
     else
     else
     return "''No table''"
     return "''No table''"