Diferencia entre revisiones de «Módulo:Infobox Urbanismo»
Ir a la navegación
Ir a la búsqueda
(Página creada con «local p = {} local argumento={} function p.run(frame) local nombreimagen = frame.args['imagen'] or '' local fechaorigen = frame.args['fecha origen'] or '' local tipo_…») |
Sin resumen de edición |
||
| (No se muestran 4 ediciones intermedias del mismo usuario) | |||
| Línea 9: | Línea 9: | ||
local tipo_via = frame.args['tipo de vía'] or '' | local tipo_via = frame.args['tipo de vía'] or '' | ||
local barrio = frame.args['barrio'] or '' | local barrio = frame.args['barrio'] or '' | ||
local tituloinfobox = frame.args['titulo infobox'] or '' | |||
if tituloinfobox ~= '' then titulo = tituloinfobox | if tituloinfobox ~= '' then titulo = tituloinfobox | ||
| Línea 22: | Línea 23: | ||
local infobox = capiunto.create( { | local infobox = capiunto.create( { | ||
top = titulo, | top = titulo, | ||
topStyle = 'background:# | topStyle = 'background:#bff4ff; padding: 10px', | ||
headerStyle = 'background:#ffffa1;' | headerStyle = 'background:#ffffa1;' | ||
} ) | } ) | ||
infobox:addImage(imagen) | infobox:addImage(imagen) | ||
infobox:addHeader('Información') | |||
infobox:addRow('Tipo de vía', tipo_via) | infobox:addRow('Tipo de vía', tipo_via) | ||
infobox:addRow('Año de origen', | infobox:addRow('Año de origen', fechaorigen) | ||
-- infobox:addHeader('Ocupación') | -- infobox:addHeader('Ocupación') | ||
Revisión actual - 10:07 21 sep 2020
La documentación para este módulo puede ser creada en Módulo:Infobox Urbanismo/doc
local p = {}
local argumento={}
function p.run(frame)
local nombreimagen = frame.args['imagen'] or ''
local fechaorigen = frame.args['fecha origen'] or ''
local tipo_via = frame.args['tipo de vía'] or ''
local barrio = frame.args['barrio'] or ''
local tituloinfobox = frame.args['titulo infobox'] or ''
if tituloinfobox ~= '' then titulo = tituloinfobox
else titulo = tostring(mw.title.getCurrentTitle()) end
if nombreimagen ~= '' then
imagen = '[[' .. nombreimagen .. '|width|300px]]'
else imagen = ''
end
local capiunto = require 'capiunto'
local infobox = capiunto.create( {
top = titulo,
topStyle = 'background:#bff4ff; padding: 10px',
headerStyle = 'background:#ffffa1;'
} )
infobox:addImage(imagen)
infobox:addHeader('Información')
infobox:addRow('Tipo de vía', tipo_via)
infobox:addRow('Año de origen', fechaorigen)
-- infobox:addHeader('Ocupación')
infobox:addRow('Barrio', barrio)
return infobox
end
return p