General

Allows to build the navigation of your website, based on the architecture inside the BO.

function/menu.html
<nav>
    <ul class="main-nav">
        #$loop|menu|1|$#
        <li class="main-nav__item
            #$if|{{childs}}$#
                menu-has-child
            #$/if$#
            ">
            <a href="{{url}}" 
               class="{{current}}" 
               {if="'{{current}}' != ''" }aria-current="page"{/if}
            >{{name}}</a>
            #$if|{{childs}}$#
                <ul>
                    #$loop|menu|2|$#
                    <li>
                        <a href="{{url}}">{{name}}</a>
                    </li>
                    #$/loop|menu|2|$#
                </ul>
            #$/if$#
        </li>
        #$/loop|menu|1|$#
    </ul>
</nav>
  • {{url}} the link of the targeted page. Can be a link or # if this is only a node page without dedicated URL

  • {{current}} will be replaced by the word "current" if you are currently on this page

  • {{blank}} - please see Open link in a new tab

  • {{name}} name of the page

  • {{childs}} returns 0 or 1

#$loop|menu|1|$#
    <-- Level 1 of links -->
    #$loop|menu|2|$#
        <-- Level 2 of links (subpages) --> 
    #$/loop|menu|2|$#
#$/loop|menu|1|$#

Last updated