Documentation

7.4 Twig template engine

Templates in Integrated use Twig. The Twig reference with tags, filters, functions operators and tests can be found at:
https://twig.symfony.com/doc/2.x/

The "Twig Reference from Symfony" items are also available, as well as the intl extension:
https://twig-extensions.readthedocs.io/en/latest/intl.html

Integrated also provides Twig functions and filters:

Integrated Twig functions

integrated_url

Returns the URL of a document for the current channel (or another channel when the channel ID is provided as second argument):

1
2
3
<a href="{{ integrated_url(document) }}">
    {{ document.title|default }}
 </a>

integrated_image

Generates an image an returns a Gregwar ImageHandler. You can use all Gregwar Image functions on it. As function argument the following items are supported:

  • An Integrated Storage object, or another object which implements the StorageInterface
  • Json representation of a storage object, as used to index a link to a storage object in Solr
  • Pathname of an image file
1
<img src="{{ integrated_image(document.cover).zoomCrop(150, 100) }}" alt="{{ document.title }}" />

integrated_active_theme

Returns the path of view, using the Integrated template locator. This is useful when using child templates to use the template locator instead of a fixed base view:

1
{% extends integrated_active_theme('content/article/show/default.html.twig') %}

Integrated Twig filters

integrated_content

Use this filter to parse content render objects like short tags. This filter should be used a render an editor field, like the article content:

1
{{ article.content|integrated_content }}