Anonimo

Modulo:DTSpecific: differenze tra le versioni

Da Wikitrek.
m
Test SecBoxBuilder
(Rename routine)
m (Test SecBoxBuilder)
Riga 204: Riga 204:
-- @frame Info from MW session
-- @frame Info from MW session
-- @return Wikitext to inject in template
-- @return Wikitext to inject in template
function p.SecBoxContent(frame)
function p.SecBoxBuilder(frame)
local SeriesQ
local SeriesQ
local Series
local Series
Riga 220: Riga 220:
local FullOutput = true
local FullOutput = true
local Output = {}
local Output = {}
--Series
if frame.args[1] ~= nil then
--Function is called from unliked page
Series = mw.wikibase.getEntity(frame.args[1])
Separator = " | "
FullOutput = false
elseif mw.wikibase.getEntity().claims["P14"][1].mainsnak.datavalue.value.id == "Q13" then
Series = mw.wikibase.getEntity()
else
Series = mw.wikibase.getEntity(QFromP("P16"))
end
--[=[
Output example
{{BoxSecondario
|Titolo= Serie {{#if: {{#statements:P16}} | {{#statements:P16}} | ''No P16<!--{{#statements:P24}}-->'' }}
|Contenuto={{#invoke:DTSpecific|SecBoxSeries|Q66}}
|Nome=BoxSecEpisodio
}}
--]=]
frame:expandTemplate{title = 'BoxSecondario', args = {Titolo = 'Title',  Contenuto = "Content", Nome = "BoxSecEpisodio"}}
end
end