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

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 · 791 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 webmasterodp, 1 week ago
4 160 7 days ago
Support · by nwhitfield, 1 week ago
2 139 1 week ago
Support · by stell, 3 weeks ago
5 370 2 weeks ago
Support · by gravinator, 1 month ago
5 564 2 weeks ago
Support · by Gravver, 3 weeks ago
6 348 3 weeks ago