Template variables
This utility allows you to access and filter the current Pages within a Site.
<ul>
{% for p in pages %}
<li>{{ p.full_path }}</li>
{% endfor %}
</ul>
Example of filtering pages by template page type
<ul>
{% for p in pages.filter({'custom_page_type': 'promotions'}) %}
<li>{{ p.full_path }}</li>
{% endfor %}
</ul>
{{ pages.filter({}, order_by='path' }}
{% for page in pages %}
{{ page.custom_fields.some_value }}
{% endif %}
{% set home_page = pages.get_one({'path': '/'}) %}
Standard page fields used in templates
Property | Text | Example |
---|---|---|
name | Name of the current page | Home |
full_path | Full page path which should be used for HTML links. If under a sub-directory, this path will contain the base_directory of the Local site/page | /local-page/about-us/ |
path | Page path set within the Site Builder. Good for looking up a particular page using filter or get_one | /about-us/ |
custom_page_type | Template page type | page_type_example |
is_published | Boolean value if the page is currently published | True |
custom_fields | Array of custom field values. Access via custom_fields.value_name | |