Developers

menulink

Generates link to site page. Use it with variables available from site.menuitems array:

{% for item in site.menuitems %}
  {% menulink item %}
{% endfor %}

#=>
<a href="/site_root/company">Company</a>
<a href="/site_root/contact">Contact information</a>

Optional parameters:

  • selected-class: class for current page and its parent pages (default: selected).
  • current-class: class for current page (default: current).
  • untranslated-class: class for untranslated pages (default: untranslated).
  • hidden-class: class for hidden pages (default: hidden).
  • wrapper-tag: wrapper tag (default: none). When present then link is wrapped to given tag and selected, current and untranslated classes is added to wrapper element.
  • wrapper-class: class that is added to wrapper tag if present (default: none).

Advanced example:

<nav><ul>
{% for item in site.menuitems %}
  {% menulink item wrapper-tag="li" wrapper-class="link" current-class="currentitem" %}
{% endfor %}
</ul></nav>

#=>
<nav><ul>
  <li class="link currentitem">
    <a href="/site_root/company">Company</a>
  </li>
  <li class="link">
    <a href="/site_root/contact">Contact information</a>
  </li>
</ul></nav>