Last active
December 15, 2022 08:28
-
-
Save ps-team/38e2e447f02adb31c969 to your computer and use it in GitHub Desktop.
Revisions
-
ps-team revised this gist
Apr 2, 2015 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,6 @@ var currentFolder = CurrentNode.Parent; var currentDepth = CurrentNode.Parent.Depth; for(int i=1; i<currentDepth; i++){ var currentAncestor = CurrentNode.Parent.AncestorAtDepth(i); foreach (var aPage in currentAncestor.Children<ContentNode>().Where(aP => aP.IsHomePage == true && aP.IncludeInMenu == true && aP.IsWebPage == true ).OrderBy(aP => aP.MenuOrder)){ -
ps-team created this gist
Apr 2, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ @using Contensis.Framework.Web @using Contensis.Framework.Web.Search <ul class="sys_menu"> @{ // Loading jQuery through the Contensis API AppContext.Current.Page.Scripts.RegisterJQuery(); if(CurrentNode != null) { var currentFolder = CurrentNode.Parent; var currentDepth = CurrentNode.Parent.Depth; var test = CurrentNode.Data.MD_Description; for(int i=1; i<currentDepth; i++){ var currentAncestor = CurrentNode.Parent.AncestorAtDepth(i); foreach (var aPage in currentAncestor.Children<ContentNode>().Where(aP => aP.IsHomePage == true && aP.IncludeInMenu == true && aP.IsWebPage == true ).OrderBy(aP => aP.MenuOrder)){ <li><a href="@aPage.Path" title="@aPage.Title">@aPage.Parent.MenuName</a></li> } } foreach (var page in currentFolder.Children<ContentNode>().Where(p => p.IsHomePage == true && p.IncludeInMenu == true && p.IsWebPage == true && p.Depth <= CurrentNode.Depth)){ if(CurrentNode.Depth == page.Depth) { <li class="sys_current-folder"><a href="@page.Path" title="@page.Title">@page.Parent.MenuName</a> <ul class="sys_sub-menu"> @foreach (var subPage in CurrentNode.Parent.Children<ContentNode>().Where(sP => sP.IsHomePage == false && sP.IncludeInMenu == true && sP.IsWebPage == true).OrderBy(sP => sP.MenuOrder)) { //If the currnet node matches the current node in the loop add current page class //Otherwise, output link as normal if(subPage.ID == CurrentNode.ID) { <li class="sys_selected"><a href="@subPage.Path" title="@subPage.Title">@subPage.MenuName</a></li> } else { <li><a href="@subPage.Path" title="@subPage.Title">@subPage.MenuName</a></li> } } </ul> </li> } } }else { <h1>CurrentNode is Null</h1> } } </ul>