How do you write to get all pages where umbracoNaviHide is set to true (checked), i.e. what is the opposite to CurrentPage.Children.Where("Visible") ? I tried "NotVisible" but it didn't work.
Or does anybody know if it possible to set a default value to umbracoNaviHide?
What I want to optain is basically "umbracoNaviShow" instead, meaning that I want to actively choose if the page should be in the navigation instead of actively choose if it shound not.
The way that you can do this is by add a property to your document type of the type true false, give it a name, and a alias. As you said you could give it a name e.g Show in navigation and a alias of umbracoNaviShow.
Then you should be able to do this in your razor code, with this it only shows pages in the navigation that have the show in navigation option checked.
@{ @* Get the root of the website *@ var root = CurrentPage.AncestorOrSelf(1); }
While trying to find an alternative by myself I found that using .Where("Visible == False") instead of .Where("Visible == True") or .Where("Visible"), would also work if one what to keep "umbracoNaviHide" as is.
umbracoNaviHide and "NotVisible"
How do you write to get all pages where umbracoNaviHide is set to true (checked), i.e. what is the opposite to CurrentPage.Children.Where("Visible") ? I tried "NotVisible" but it didn't work.
Or does anybody know if it possible to set a default value to umbracoNaviHide?
What I want to optain is basically "umbracoNaviShow" instead, meaning that I want to actively choose if the page should be in the navigation instead of actively choose if it shound not.
Thanks for any suggestions,
Martin
Hi Martin.
The way that you can do this is by add a property to your document type of the type true false, give it a name, and a alias. As you said you could give it a name e.g Show in navigation and a alias of umbracoNaviShow.
Then you should be able to do this in your razor code, with this it only shows pages in the navigation that have the show in navigation option checked.
Hope this helps,
/Dennis
Thanks for the example Dennis.
While trying to find an alternative by myself I found that using .Where("Visible == False") instead of .Where("Visible == True") or .Where("Visible"), would also work if one what to keep "umbracoNaviHide" as is.
//
Martin
is working on a reply...