Anonimo

Modulo:DTSpecific: differenze tra le versioni

Da Wikitrek.
m
Test Series
mNessun oggetto della modifica
m (Test Series)
Riga 11: Riga 11:
local SeasonsQty = require('Modulo:DTSem').SeasonsQty
local SeasonsQty = require('Modulo:DTSem').SeasonsQty
local LabelOrLink = require('Modulo:DTBase').LabelOrLink
local LabelOrLink = require('Modulo:DTBase').LabelOrLink
--local PropertiesOnTree = require('Modulo:DTFunzioniComuni').PropertiesOnTree
local SeriesTree = require('Modulo:DTFunzioniComuni').SeriesTree


--- generates a list of backlink using SMW query.
--- generates a list of backlink using SMW query.
Riga 206: Riga 208:
function p.SecBoxBuilder(frame)
function p.SecBoxBuilder(frame)
local TemplateName
local TemplateName
local BoxTitle
local BoxContent
local SeriesQ
local SeriesQ
local Series
local Short
local Short
local CategoryNames = {}
local CategoryNames = {}
Riga 226: Riga 230:
TemplateName = string.gsub(frame:getParent():getTitle(), "Template:", "")
TemplateName = string.gsub(frame:getParent():getTitle(), "Template:", "")
--Series
if TemplateName == "BoxSecEpisodio" then
Series = SeriesTree(frame)
BoxTitle = "Titolo BoxSecEpisodio"
BoxContent = "Contenuto BoxSecEpisodio<br />" .. Series
else
--Series
if frame.args[1] ~= nil then
if frame.args[1] ~= nil then
--Function is called from unliked page
--Function is called from unliked page
Riga 233: Riga 242:
FullOutput = false
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
-- Page is instance of Series
Series = mw.wikibase.getEntity()
Series = mw.wikibase.getEntity()
elseif  mw.wikibase.getEntity().claims["P16"] ~= nil then
elseif  mw.wikibase.getEntity().claims["P16"] ~= nil then
Series = mw.wikibase.getEntity(QFromP("P16"))
Series = mw.wikibase.getEntity(QFromP("P16"))
else
else
Series = ""
-- Fall back to Short Treks
Series = mw.wikibase.getEntity("Q8537")
end
end
BoxTitle = "Titolo " .. TemplateName
BoxContent = "Contenuto " .. TemplateName
end
--[=[
--[=[
Riga 249: Riga 267:
}}
}}
--]=]
--]=]
return frame:expandTemplate{title = 'BoxSecondario', args = {Titolo = BoxTitle,  Contenuto = BoxContent, Nome = TemplateName}}
return frame:expandTemplate{title = 'BoxSecondario', args = {Titolo = 'Title',  Contenuto = "Content<br />" .. TemplateName, Nome = TemplateName}}
end
end