Extension:Closures

The Closures extension provides a way for users to define templates on the page they are needed through a parser function. This is especially useful combination with parser functions that take the name of a template as a parameter and use that for outputting data.

Usage
The extension defines the parser function. The text before the first pipe in this parser function will become the name of the closure and everything after that becomes the body of the closure. This means that escaping pipes in the body is not necessary.

A closure acts exactly like a regular template. This means it is possible to use template variables, templates, parser functions and even other closures in a closure. This also means closures can be transcluded on the page using regular templating syntax.

Furthermore, closures allow you to override existing templates with custom behaviour by defining a closure with the same name as an existing template.

Example
Below is this example from Semantic MediaWiki, adapted to use closures instead:

{{#closure: TableHeader | }}

MediaWiki 1.39.x LTS Test Plan
The items listed here are general issues related to MediaWiki 1.39.x LTS. They are not addressing any issues that are specific to this extension.


 * Extension considered active for MediaWiki 1.39.x LTS