Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 701 Bytes

04-twig_functions.md

File metadata and controls

26 lines (18 loc) · 701 Bytes

Theodo RogerCMSBundle

WARNING: This bundle is still under developement and is not considered stable.

Twig functions

RogerCMS' twig extension adds 2 functions and one tag:

  1. {% snippet 'snippet_name' %}
  2. {{ page_url(page_slug) }}
  • takes page slug as parameter
  • generates a full url (concatenated with all ascendants)
  1. {{ media_url() }}
  • takes media name as parameter

Roger's TwigLoaderRepository extends also existing functions: include and extends by adding three keywords to them:

  • page
  • layout
  • name

You can use them to retrieve required element by following type by its name {% extends 'layout:main' %}, {% include 'page:My Page' %}