Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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 · 880 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 TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 24 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago