Differenze tra le versioni di "Modulo:AIRBox"

Da Wiki Acquisti in rete PA.
m
m
Riga 16: Riga 16:
         local header = mw.html.create('div')
         local header = mw.html.create('div')
         header:addClass('box-header')
         header:addClass('box-header')
        if icona ~= "" then
            local icon = mw.html.create('div')
            icon:addClass('box-icon')
            icon:wikitext(icona)
            header:node(icon)
        end
         header:wikitext(titolo)
         header:wikitext(titolo)
         output:node(header)
         output:node(header)
Riga 22: Riga 30:
     local body = mw.html.create('div')
     local body = mw.html.create('div')
     body:addClass('box-body')
     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)
     local expandedText = frame:preprocess(testo)

Versione delle 11:03, 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')

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

        header:wikitext(titolo)
        output:node(header)
    end

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

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

    return tostring(output)
end

return p