The page order sets the order of the menu items, see the learn site
Archive
Hey, I have the same issue.
I added a menu item using site.yaml, the item is being rendered and the href is correct but the link does't work when clicked.
I tried clearing the cache and refreshing multiple times but that doesn't help.
Anyone knows how to solve this?
Thanks!
For future reference, I found out why the link was not working:
It's the singlePageNav.js Plugin that is being used (https://github.com/ChrisWojcik/single-page-nav), that causes links away from the single page not to work.
I finally found the solution while inspecting the plugin's sample page:
For links away from the page you need to add the class "external" to the <a> element.
My modular.html.twig file now looks like this:
TWIG
...
{% for mitem in site.menu %}
<li>
<a class="external" href="{{ mitem.url }}">
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
{{ mitem.text }}
</a>
</li>
{% endfor %}
...
---
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1362 | 9 years ago | ||
| 2 | 939 | 9 years ago | ||
| 2 | 4069 | 9 years ago | ||
| 1 | 2959 | 9 years ago | ||
| 3 | 1123 | 9 years ago |