Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Separator item to dropdown menu

first-time

Started by Mark 8 years ago · 0 replies · 621 views
8 years ago

Hi. Please help to understand.
In the site menu there is a separator item, when you hover on it opens drop-down menus.
But, the separator item refers to the page. If you click on this item you will see a page without content.
How to make this item a separator without a link to page
Where to read about it?
Thanks so much!
scrin_menu|690x261

The code that works in the menu

TWIG
{% macro loop(page) %}
{% for p in page.children.visible %}
{% set current_page = (p.active or p.activeChild) ? 'uk-active' : '' %}
{% if p.children.visible.count > 0 %}
    <li class="uk-parent {{ current_page }}" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false">
        <a class="uk-navbar-nav-subtitle" href="{{ p.url }}">{{ p.menu }}</a>
    <div class="uk-dropdown uk-dropdown-small uk-dropdown-bottom uk-dropdown-width-1">
        <div class="uk-grid uk-dropdown-grid">
            <div class="uk-width-1-1">
                <ul class="uk-nav uk-nav-navbar">
                {{ _self.loop(p) }}
                </ul>
            </div>
        </div>
    </div>
    </li>
{% else %}
    <li class="{{ current_page }}">
        <a class="uk-navbar-nav-subtitle" href="{{ p.url }}">
            {{ p.menu }}
        </a>
    </li>
{% endif %}
{% endfor %}
{% endmacro %}

<ul class="uk-navbar-nav uk-visible-large">
{{ _self.loop(pages) }}
</ul>
last edited 01/30/19 by Mark

Suggested topics

Topic Participants Replies Views Activity
Support · by blu3prince, 4 days ago
1 78 11 hours ago
Support · by complanar, 7 days ago
6 162 2 days ago
Support · by Rick Beebe, 7 days ago
2 121 4 days ago
Support · by alex, 5 days ago
2 103 4 days ago
Support · by Marcel, 2 weeks ago
1 155 5 days ago