Currently it's showing all of the children nodes for all of the parent nodes, regardless of which page you're on, but you only want to show child nodes when you're in that section, right?
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'PageName' and no extension method 'PageName' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 396:
Line 397: <li class="@isPageSelected">
Line 398: <a href="@page.Url">@page.PageName</a> Line 399:
Line 400: @if (CurrentPage.Children.Where("umbracoNaviHide!= true").Count() > 1 && page.IsAncestorOrSelf(Model.Content))
Source File: c:\Users\ibrahim.tunc\Documents\My Web Sites\UIS\Views\ContentPage.cshtml Line: 398
Navigation including parent and siblings or just siblings depending on level
Hi,
I'm trying to create a global sidebar nav that works like this:
Home
- Parent (show siblings when here)
- Child (show parent and siblings when here)
- Child (show parent and siblings when here)
-Parent
For some reason, I can't get the script to only show the children of the parent you're on, here's what I'm working with. Any ideas?
Hi Amir,
Currently it's showing all of the children nodes for all of the parent nodes, regardless of which page you're on, but you only want to show child nodes when you're in that section, right?
So I think if you change this:
...to check whether you're in this particular section, it should work:
Hope I've understood correctly and this helps :)
Dan, this is fanastic, thank you!
how can add or change @subitem.Name I want to different field name. For Exmp: @Model.PageName
Thanks Best Regard.
Hi ibrahim,
Try this:
/Dennis
Hi!. Denniz.
I Did. but gave me following error.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'PageName' and no extension method 'PageName' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 396: Line 397: <li class="@isPageSelected"> Line 398: <a href="@page.Url">@page.PageName</a> Line 399: Line 400: @if (CurrentPage.Children.Where("umbracoNaviHide!= true").Count() > 1 && page.IsAncestorOrSelf(Model.Content))
Source File: c:\Users\ibrahim.tunc\Documents\My Web Sites\UIS\Views\ContentPage.cshtml Line: 398
input
output
Where am I doing wrong? Can you help me please.
is working on a reply...