Skip to Content

Link

The link object describes a navigation link, including its URL, title, type, and related objects.

Usage Example

{%- comment -%} Render a navigation menu {%- endcomment -%} <ul> {% for link in linklist.links %} <li> <a href="{{ link.url }}" {% if link.active %}class="active"{% endif %}>{{ link.title }}</a> {% if link.links.size > 0 %} <ul> {% for child in link.links %} <li><a href="{{ child.url }}">{{ child.title }}</a></li> {% endfor %} </ul> {% endif %} </li> {% endfor %} </ul>

Properties

active

Returns true if this link is currently active that is link is part of the current URL.

child_active

Returns true if this links child is currently active.

current

Returns true if this link matches to the current page and is the link for the current page.

child_current

Returns true if this links child is current.

levels

Returns the total amount levels below this link.

Returns the child links for this link.

object

Access the object related to this link. Possible objects are:

title

Returns the title.

type

Returns the type.

url

Returns the url.

target

Returns the target.