Jump to content

Module:OOOFAQ

From Out of Ore Wiki
Revision as of 21:42, 3 March 2026 by Tattecko (talk | contribs) (Created page with "local p = {} function p.render(frame) local args = frame:getParent().args local html = mw.html.create('div') :addClass('ooo-faq') local index = 1 while args['question' .. index] do local question = args['question' .. index] local answer = args['answer' .. index] or '' local item = html:tag('div') :addClass('mw-collapsible mw-collapsed ooo-faq__item') item:tag('div') :addClass('ooo-faq__q...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:OOOFAQ/doc

local p = {}

function p.render(frame)
    local args = frame:getParent().args
    local html = mw.html.create('div')
        :addClass('ooo-faq')

    local index = 1

    while args['question' .. index] do
        local question = args['question' .. index]
        local answer = args['answer' .. index] or ''

        local item = html:tag('div')
            :addClass('mw-collapsible mw-collapsed ooo-faq__item')

        item:tag('div')
            :addClass('ooo-faq__question')
            :wikitext(question)

        item:tag('div')
            :addClass('mw-collapsible-content ooo-faq__answer')
            :wikitext(answer)

        index = index + 1
    end

    return tostring(html)
end

return p