This is my first ever post on the umbraco forums, but I've started using it only recently, so there ya go.
I'm working on the navigation for a site that I am building using Umbraco 4.7 using razor (I simply hate XSLT) yet somehow the menu will always show the items that I hide using "Hide in Menu"
Got some fast responses on Twitter, but they couldn't know that jbreuer here, added an extra property to divide hide in sitemap and hide in menu, so I had to check another property. So now using
Problem with umbracoNaviHide
Hi,
This is my first ever post on the umbraco forums, but I've started using it only recently, so there ya go.
I'm working on the navigation for a site that I am building using Umbraco 4.7 using razor (I simply hate XSLT) yet somehow the menu will always show the items that I hide using "Hide in Menu"
The razor script I am using is as follows.
<ul class="navigation">
@foreach (var c in currentPage.Children.Where("umbracoNaviHide!=true"))
{
if (c.Id == activePage.Id)
{
<li><a href="@c.Url">@c.Name</a><div class="active"></div></li>
}
else
{
<li><a href="@c.Url">@c.Name</a></li>
}
}
</ul>
}
I will be gratefull if you can help me fix this. :)
Fixed this!
Got some fast responses on Twitter, but they couldn't know that jbreuer here, added an extra property to divide hide in sitemap and hide in menu, so I had to check another property. So now using
currentPage.Children.Where("hideInMenu != true)
it works like a charm!
Thanks to everyone that tied to help.
is working on a reply...