Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

GRAV One-Page Antimatter Theme

Started by Muut Archive 11 years ago · 22 replies · 1125 views
10 years ago

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!

10 years ago

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 %}
...
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2957 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago