Skip to main content

Using Smarty

For kwilo, we are using the Smarty Template Engine for rendering each output. Smarty has the concept of functions and modifiers. Functions can be called with or without any arguments to e.g. load other data. Modifiers transform existing input into other output.

Functions

kwilo provides the following functions:
Function signatureDescription
asset_lib()Create the URL to the default templates libs.bundle.css file.
asset_theme()Create the URL to the default templates theme.bundle.css file.
asset_custom()Create the URL to the default templates custom.css file.

Available PHP functions

Because of security reasons, only a small number of PHP functions is available. Those are:

  • isset
  • empty
  • count
  • sizeof
  • in_array
  • is_array

On-premises customers can enable more functions as they like to.

Modifiers

kwilo provides the following modifiers:
Modifier signatureDescription
image(GUID $guidOfImage)Create URL to uploaded image
image_alias(string $aliasNameOfImage)Create URL to uploaded image
image_in_layout(string $filename)Create URL to uploaded image which is inside the layout
css(GUID $guidOfCss)Create URL to uploaded CSS file
css_alias(string $aliasNameOfImage)Create URL to uploaded CSS file
css_in_layout(string $filename)Create URL to uploaded CSS file which is inside the layout
language_proficiency_avg(array $languageProficiency)Calculates the language proficiency average. You have to pass the language_proficiency key from your GraphQL query to this
markdown(string $content)Transforms the $content into markdown