Differenze tra le versioni di "Modulo:AIRBox"

Da Wiki Acquisti in rete PA.
(Creata pagina con "-- Nome del modulo: AIRBox local p = {} function p.renderBox(args) local titolo = args.titolo or "Da sapere che" local testo = args.testo or "" local icona = args.icona or "" local output = mw.html.create('div') output:addClass('multibox') if titolo ~= "notitolo" then local header = mw.html.create('div') header:addClass('box-header') header:wikitext(titolo) output:node(header) end local body = mw.html.c...")
 
m
Riga 3: Riga 3:
local p = {}
local p = {}


function p.renderBox(args)
function p.renderBox(frame)
    local args = frame.args
 
     local titolo = args.titolo or "Da sapere che"
     local titolo = args.titolo or "Da sapere che"
     local testo = args.testo or ""
     local testo = args.testo or ""
Riga 11: Riga 13:
     output:addClass('multibox')
     output:addClass('multibox')


     if titolo ~= "notitolo" then
     if titolo ~= "ciaone" then
         local header = mw.html.create('div')
         local header = mw.html.create('div')
         header:addClass('box-header')
         header:addClass('box-header')
Riga 28: Riga 30:
     end
     end


     body:wikitext(testo)
    local expandedText = frame:preprocess(testo)
     body:wikitext(expandedText)
     output:node(body)
     output:node(body)



Versione delle 11:01, 29 mag 2023

La documentazione per questo modulo può essere creata in Modulo:AIRBox/man

-- Nome del modulo: AIRBox

local p = {}

function p.renderBox(frame)
    local args = frame.args

    local titolo = args.titolo or "Da sapere che"
    local testo = args.testo or ""
    local icona = args.icona or ""

    local output = mw.html.create('div')
    output:addClass('multibox')

    if titolo ~= "ciaone" then
        local header = mw.html.create('div')
        header:addClass('box-header')
        header:wikitext(titolo)
        output:node(header)
    end

    local body = mw.html.create('div')
    body:addClass('box-body')

    if icona ~= "" then
        local icon = mw.html.create('div')
        icon:addClass('box-icon')
        icon:wikitext(icona)
        body:node(icon)
    end

    local expandedText = frame:preprocess(testo)
    body:wikitext(expandedText)
    output:node(body)

    return tostring(output)
end

return p