Extension:TemplateFunc

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:Extensions with no license specified
MediaWiki extensions manual
TemplateFunc
Release status: stableCategory:Stable extensions
Implementation Parser function Category:Parser function extensions
Author(s) DG
Latest version 0.1
MediaWiki 1.39+Category:Extensions with manual MediaWiki version
License No license specified
Download Category:Extensions in GitHub version control
Category:All extensionsCategory:Extensions not in ExtensionJson

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.

See Github for more details.

Installation

  • Download and place the file(s) in a directory called TemplateFunc in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'TemplateFunc' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Category:All extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions with no license specified Category:Extensions without a compatibility policy Category:Extensions without an image Category:Parser function extensions Category:Stable extensions