PageFactory (Kirby Plugin)

TransVars

The term "TransVars" is an abbreviation of "translation variables" and is used as a generic term for both "Variables" and "Macros".

 

The mechanism behind TransVars is deliberately kept simple and straight forward, yet compatible with Twig.

Variables

  • are replaced with their values
  • are intrinsically language aware, thus the result depends on the currently active language

Macros

  • render computed output (similar to functions in programming languages)
  • accept function arguments (→ as relaxed JSON)
  • provide their own documentation if invoked with "help" as argument (e.g. {{ macro(help) }})
  • are available to Twig

Built-in Macros

PageFactory ships with a set of predefined Macros for some of the most common purposes.

Custem Macros

There is a straight forward path to creating Custom Macros in PHP.

Extension Macros

There is a mechanism for extending PageFactory.
Such extensions can provide additional Macros (and Variables and more).