Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Remove HOME menu link from Home Page

Started by Peter Hanlon 9 years ago · 1 replies · 1460 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 jeremycherfas, 1 week ago
4 180 2 days ago
General · by lynbor, 5 days ago
2 119 3 days ago
General · by Old Man Umby, 1 week ago
1 100 1 week ago
General · by Sebastian, 1 week ago
1 124 1 week ago
General · by Andy Miller, 3 weeks ago
0 248 3 weeks ago