IMSLP:Fast Template Expansion


Fast Template Expansion (FTE) is a mechanism for fast template inclusions, and consists of a parser function for user input (#fte:) plus various injected internal variables to be used in template replacement. The template itself and its messages/translations reside in the Mediawiki:FTE: namespace, and can be edited by all sysops and translators/sitedesigners.

FTE is to be introduced in IMSLP v1.0alpha in order to allow certain IMSLP contributors to improve on the main page templates/styles without needing to request code changes. Normal Mediawiki templates, used prior to the internalization (converting to parser function) of the three main templates (composer, work, file), provide a similar level of customization, but at the cost of a drastic decrease in site performance and speed, and sometimes the readability of the template itself.

On the other hand, due to the cached nature of FTE templates, they as fast as internal parser functions, but also allows for a great amount of possible change and improvement by certain IMSLP contributors. To achieve this goal each FTE template is divided into two sections:

  1. The user-editable pages in Mediawiki:FTE:. (External section)
  2. Various template variables injected into template expansion. This is to compensate for the fact that due to design no normal templates will be expanded in the FTE pages. (Internal section)

The variables injected by the vary from template to template, and are code-supported. Thus, valid FTE templates must be specified in the code and no additional templates may be added without code changes. However, due to the relatively stable nature of FTE templates (we don't expect the File template to disappear tomorrow), this is not much of a drawback.

External Half of FTE Templates


Internal Half of FTE Templates