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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

How to hide a menu item in a different language?

Solved by Marco Cevoli View solution

Started by Marco Cevoli 8 years ago · 2 replies · 576 views
8 years ago

Hi,

I've just launched my new web site, www.marcocevoli.com and I was wondering what is the right procedure to hide a menu item in a multilingual environment.

I mean, if I want to hide the Blog section from the English version of my site, how do I do that?

(The above site is currently in Italian only, partially translated to Spanish.)

Thanks in advance,

Marco

8 years ago Solution

Well, I was bit tired, I must admit...

I've created the translated page blog.es.md and set "published" to "false".

Is it really that simple? I think I'm still missing something...

👍 1
8 years ago

For anyone else interested, you can also check if p.home is true or false (assuming you are looping through a page collection using the var p) in Twig to then not display the Homepage link in the menubar. This works in multi-language, while checking for a slug etc. may not.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 60 15 hours ago
Support · by Anna, 3 days ago
2 66 18 hours ago
Support · by Justin Young, 19 hours ago
1 33 19 hours ago
Support · by Duc , 1 week ago
2 69 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago