Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu item is clickable for folders with subpages leading to 404 #103

Open
olivierdalang opened this issue Apr 21, 2017 · 2 comments
Open

Comments

@olivierdalang
Copy link
Contributor

Hi,

With dropdown enabled, when I have a folder (with no content) containing subpages, the folder is clickable in the navigation, leading to a 404.
I think the navigation should not create links when the page is not routable.

I fixed it like this in templates/partials/navigation.html.twig:

{% macro loop(page) %}
...
                <a href="{{ p.url }}">
...
{% endmacro %}

replaced by

{% macro loop(page) %}
...
                <a href="{% if p.routable %}{{ p.url }}{% else %}#{% endif %}">
...
{% endmacro %}

I think a proper fix would even remove the tag, but this needs a bit more work so that it displays correctly.

Thanks !

@axza
Copy link

axza commented Sep 26, 2018

this needs to be documented aswell in the quark theme or on learn.getgrav.org !
@rhukster

@bcneb
Copy link

bcneb commented Apr 3, 2019

Thankyou for this, I was looking for a fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants