Skip to content
Grav 2.0 is officially stable. Read the announcement →
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 · 723 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 Paul Hodges, 4 weeks ago
19 484 5 days ago
Support · by Lauw, 7 days ago
2 99 7 days ago
Support · by Anna, 3 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 484 3 weeks ago