Extension:TemplateFunc
![]() Release status: stableCategory:Stable extensions |
|
---|---|
Implementation | Parser functionCategory:Parser function extensions |
Author(s) | DG |
Latest version | 0.1 |
MediaWiki | 1.39+Category:Extensions with manual MediaWiki version |
License | No license specified |
Download | GitHub: Note: |
The TemplateFunc extension offers parser functions for fetching structured data from wiki pages and converting them to other data formats for use in the wiki, including wiki template markup, JSON, Mustache templates and Smarty widgets. It was specifically created to work with multiple-instance templates and to offer solutions to issues that are expected to arise in the future as Parsoid takes over as the de facto MediaWiki parser. It may be useful, too, if the use of Lua/Scribunto is not a viable option on your wiki.
The extension enables two new parser functions:
#tf-convert
- the main parser function, which allows you to read a template's data on a wiki page and re-assign those data to a different format, such as a different wiki template, Smarty widget or JSON representation.#tf-mustache
- a dedicated parser function for using Mustache templates.
The extension is developed and maintained for CODECS, a Semantic MediaWiki-driven wiki for Celtic studies.
Installation
- Download and place the file(s) in a directory called
TemplateFunc
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'TemplateFunc' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.