Using theme Quark, how would I make a top-level dropdown menu non-clickable?
All help appreciated! [And why is this hard - it seems to be a basic usability requirement.]
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Solved by pamtbaau View solution
Using theme Quark, how would I make a top-level dropdown menu non-clickable?
All help appreciated! [And why is this hard - it seems to be a basic usability requirement.]
@andro, To make a toplevel dropdown menu item non-clickable in theme Quark, you can do the following:
user/themes/quark/templates/macros/macros.html.twig into folder user/themes/mytheme/templates/macros/In the copied file, replace lines 6-13 with:
{% if p.children.visible.count > 0 %}
<a class="{{ active_page }}"> {# Without 'href' it doesn't do anything #}
{{ p.menu }}
</a>
<ul>
{{ macros.nav_loop(p) }}
</ul>
{% else %}
<a href="{{ p.url }}" class="{{ active_page }}">
{{ p.menu }}
</a>
{% endif %}
The toplevel menu item will now be unresponsive and only shows its child pages.
And why is this hard - it seems to be a basic usability requirement.
It is a design choice of the devs. Some want it to be clickable, other don't. They could have make it an option in the theme though.
@andro, Any luck yet in making the top-level menu-item of a dropdown non-clickable?
Please mark your post as solved because pamtbaau's suggestion fixes the problem. Thank you
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 4 | 193 | 2 months ago | ||
| 3 | 90 | 2 months ago | ||
| 11 | 449 | 3 months ago | ||
| 0 | 43 | 3 months ago | ||
| 5 | 123 | 3 months ago |