Module:Collapsible/doc
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.