The template tags¶
The template tags provide a way to include a menu, or breadcrumb in the website. Load the tags using:
{% load fluent_pages_tags %}
The breadcrumb¶
The breadcrumb of the current page can be rendered using:
{% render_breadcrumb %}
It’s possible to render the breadcrumb using a custom template:
{% render_breadcrumb template="fluent_pages/parts/breadcrumb.html" %}
The breadcrumb template could look like:
{% if breadcrumb %}
<ul>
{% for item in breadcrumb %}
<li{% if forloop.last %} class="last"{% endif %}><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
Advanced features¶
Fetching ‘site’ and ‘page’ variables¶
The templates receive a site
and page
variable by default.
In case the template is rendered outside the regular loop, these fields can be fetched:
{% get_fluent_page_vars %}
Locating custom page type views¶
When a custom page type provides additional views, these can be fetched using:
{% load appurl_tags %}
{% appurl "my_viewname" %}
{% appurl "my_viewname" arg1 arg2 %}
{% appurl "my_viewname" kwarg1=value kwargs2=value %}
These tags locate the page in the page tree, and resolve the view URL from there.