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

Non clickable menu item

Started by Muut Archive 10 years ago · 4 replies · 879 views
10 years ago

I would like to make a menu item not clickable. I have read a post that described how but it was so vague that it couldn't be used. Could someone help me? please! :(

10 years ago

Out of the box GRAV doesnt have a feature to display a link-less menu item, the logic in template navigation twig file is to iterate pages and render menu item name and link. Anyway you could edit the navigation twig template, it will depends on your theme, if you just need a fixed text as a menu item, you could also edit the navigation twig file and simply add a <li>Text</li>. Again, it will depends on your theme.

10 years ago

You could easily add a custom header like: linkless: true and then in your theme's navigation twig logic, check for this header and skip outputting the <a></a> tag if set to true.

10 years ago

i have added the linkless: true into the header. then created navigation.html.twig in the templates folder in the the deliver theme as it has it in the partials folder but not in the main folder. I would click on the menu and it would take me to a blank page with just the name of the menu item link.

10 years ago

hola Santiago, the only file you need to modify is navigation.html.twigin partials folder. hablas español?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1362 9 years ago
Archive · by Muut Archive, 9 years ago
2 939 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2959 9 years ago
Archive · by Muut Archive, 9 years ago
3 1123 9 years ago