Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Remove HOME menu link from Home Page

Started by Peter Hanlon 9 years ago · 1 replies · 1525 views
9 years ago

For my home page, I've set visible: false in the advanced options. In doing so, Home nav menu is removed when navigating to all other pages such as About, Contact, etc.

Is there a way to only have the Home menu link to not be visible when on the home page but visible on all other pages?

I searched in the form and did not find a solution and apologize if this is a repeated question.

Thank you.

9 years ago

While you could do this with some fancy logic in your navigation twig, frankly I would just use CSS to hide the home link on the home page. This could be done with a body class that is being set on the homepage, and then something like:

CSS
.homepage ul.mainmenu li:first-child {
 display: none;
}

Of course this depends on your CSS

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Andy Miller, 6 days ago
0 107 6 days ago
General · by lynbor, 1 month ago
3 437 2 weeks ago
General · by lynbor, 3 weeks ago
7 555 2 weeks ago
General · by Harry, 2 weeks ago
0 159 2 weeks ago
General · by Old Man Umby, 1 month ago
2 308 3 weeks ago