Redirecting…

Functions

General functions available to themes.

Menus

Returns an HTML list containing links. The active page has a CSS class of active.

Usage

{{ page | menus, start_level=1, end_level=15 }}

Example

{{ page | menus, 1, 3 }}

Exporting

Returns true if the template is being exported as HTML.

Usage

{% if exporting %}
  <p>Only shown if exporting is true.</p>
{% endif %}

Editing

Returns true if the editor is present on the current page.

Usage

{% if edit_mode %}
  <p>Useful information while editing.</p>
{% endif %}

Viewing

Returns true if the editor is not present on the current page. This can be useful if JavaScript is conflicting with the editor.

Usage

{% if view_mode %}
  <p>This page is not being edited.</p>
{% endif %}

Logged In

Returns true if the viewer of the page is logged in.

Usage

{% if logged_in %}
  <p>Information displayed only to logged in users.</p>
{% endif %}

Include

Inserts the contents of the named module at the location of the tag.

Usage

{% include 'my_module' %}

Example

The theme's layout contains the following:

{% include 'header' %}
<p>I hope you find what you're looking for :)</p>

The header module contains:

<h1>Welcome to my website!</h1>

When the page is viewed, the user would see:

<h1>Welcome to my website!</h1>
<p>I hope you find what you're looking for :)</p>