67 652
contributi
m (Format) |
(Modular SecBoxContent) |
||
Riga 215: | Riga 215: | ||
local Preposizione | local Preposizione | ||
local Others | local Others | ||
local Separator ="<hr />" | |||
local FullOutput = true | |||
local Output = {} | |||
--Series | --Series | ||
Riga 220: | Riga 223: | ||
--Function is called from unliked page | --Function is called from unliked page | ||
Series = mw.wikibase.getEntity(frame.args[1]) | Series = mw.wikibase.getEntity(frame.args[1]) | ||
Separator = " | " | |||
FullOutput = false | |||
elseif mw.wikibase.getEntity().claims["P14"][1].mainsnak.datavalue.value.id == "Q13" then | elseif mw.wikibase.getEntity().claims["P14"][1].mainsnak.datavalue.value.id == "Q13" then | ||
Series = mw.wikibase.getEntity() | Series = mw.wikibase.getEntity() | ||
Riga 253: | Riga 258: | ||
end | end | ||
Categories = tostring(UL) | Categories = tostring(UL) | ||
table.insert(Output, Categories) | |||
Quantity = SeasonsQty(Short) | Quantity = SeasonsQty(Short) | ||
Riga 277: | Riga 284: | ||
end | end | ||
Seasons = tostring(UL) | Seasons = tostring(UL) | ||
table.insert(Output, Seasons) | |||
end | end | ||
--Other pages | if FullOutput then | ||
--Other pages | |||
UL = mw.html.create('ul') | |||
UL | |||
:attr('class', "compactul") | |||
:attr('title', "Altre pagine") | |||
LI = mw.html.create('li') | |||
LI:wikitext("[[Personaggi ricorrenti " .. Preposizione .. " " .. Short .. "]]") | |||
UL:node(LI) | |||
Others = tostring(UL) | |||
table.insert(Output, Others) | |||
end | |||
if FullOutput then | |||
--All Series | |||
local SeriesQuery = mw.smw.getQueryResult('[[Istanza::Serie]]|?Abbreviazione|sort=Ordinale|order=asc') | |||
if SeriesQuery == nil then | |||
Series = "''Nessun risultato''" | |||
end | |||
if type(SeriesQuery) == "table" then | |||
UL = mw.html.create('ul') | |||
UL | |||
:attr('class', "compactul") | |||
:attr('title', "Tutte le serie") | |||
for _, CurrSeries in ipairs(SeriesQuery.results) do | |||
--In the output, example: | |||
--"fulltext": "Star Trek: Strange New Worlds", | |||
LI = mw.html.create('li') | |||
LI:wikitext("[[" .. CurrSeries.fulltext .. "|" .. CurrSeries.printouts.Abbreviazione[1] .. "]]") | |||
UL:node(LI) | |||
end | |||
Series = tostring(UL) | |||
else | |||
Series = "''Il risultato non è una TABLE''" | |||
end | |||
table.insert(Output, Series) | |||
end | |||
--return Categories .. "<hr />" .. Seasons .. "<hr />" .. Others .. "<hr />" .. Series | |||
return table.concat(Output, Separator) | |||
--[==[ | --[==[ | ||
<strong>Categorie</strong> | <strong>Categorie</strong> |