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 (part of the current URL).

child_active

Returns true if this link’s child is currently active.

child_current

Returns true if this link’s child is current.

current

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

levels

Returns the total number of levels below this link.

Returns the child links for this link.

object

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

target

Returns the target attribute for the link.

title

Returns the title of the link.

type

Returns the type of the link.

url

Returns the URL of the link.

Last updated on