Module:Collapsible/doc

From Chalo Chatu, Zambia online encyclopedia
Revision as of 07:53, 19 September 2025 by Chalochatu (talk | contribs) (Created page with "This module is a small compatibility shim that exposes a function named collapsible. It forwards calls to an available renderer so that legacy templates using {{#invoke:…|collapsible}} do not break. == Purpose == Some imported templates call: <code>{{#invoke:Collapsible|collapsible|...}}</code> or <code>{{#invoke:Collapsible list|collapsible|...}}</code> On Chalo Chatu the primary entrypoint is main in Module:Collapsible list. This shim looks for that first; if u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This is the documentation page for Module:Collapsible

This module is a small compatibility shim that exposes a function named collapsible. It forwards calls to an available renderer so that legacy templates using Script error: No such module "…". do not break.

Purpose

Some imported templates call:

    or Script error: The function "collapsible" does not exist.

    On Chalo Chatu the primary entrypoint is main in Module:Collapsible list. This shim looks for that first; if unavailable, it may fall back to a compatible function in Module:Navbox (if present). If neither exists, it returns a clear error message.

    Usage

    Prefer the direct entrypoint:

      Only use this shim for legacy code that cannot be edited:

        Parameters

        Identical to Module:Collapsible list’s main:

        title / header
        Heading text.
        collapsed
        yes / no. Adds class collapsed when yes.
        1..50
        Positional items.
        class, id, list_style, item_style
        Optional styling hooks passed through when supported.

        Behavior

        • If Module:Collapsible list with function main(frame) exists, all arguments are forwarded to it.
        • Else, if Module:Navbox with function navbox(frame) exists, arguments are forwarded as-is (output may differ).
        • Else, a readable Module error string is returned.

        Migration guidance

        Where possible, update templates to call:

          This reduces indirection and makes behavior explicit.

          Troubleshooting

          • If you still see "Script error: The function 'collapsible' does not exist", ensure this page (Module:Collapsible) is created and that Module:Collapsible list exists with a main function.
          • If output appears but styling looks plain, add CSS for .chalo-collapsible classes in MediaWiki:Common.css.

          See also