Quick Nav:  Online Store   |   Login | Register

Show Cohorts and Children of Active Page

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
rekreisler
<20 Posts
Posts:7


04/11/2008 9:05 PM  

Hi, thanks to the success of the menus I was able to achieve using a custom template for top and home navigation, I've been asked to create a fancier side menu.  I'm not completely sure it can be done, so I figured I'd ask the experts before spending too much time on it.  I need to display the current page and its siblings, as well as their children, with the children of the current page showing expanded by default.  I've sketched it out here - the + and - are like elements of a tree control which allow you to show or hide the children of the page.

 

+Sibling of Current Page

+Sibling of Current Page

-Current Page

    Child of Current Page

    Child of Current Page

+Sibling of Current Page

 

I figured I should set the level="0-99" (unless I can dynamically set the levels to just the current level and the next deepest level), then in a custom template get the level of the active page using Page.PageLevel and Page.IsActive (not sure if I can get this outside of the iteration through the page hierarchy - if I can't, I'm not sure that any of this will work unless I can set the level dynamically in the skin).  Once that is set, I can choose to only populate my parent ul with pages from the active level, and populate a nested ul for each sibling page which has children with the child pages (using Page.HasChildren to determine whether I nest a ul or not).  The tree control aspect would be controlled with css and javascript.

 

Does this sound like a reasonable plan?  Am I able to set the level range dynamically in the skin (sorry, I'm not sure if I can do that or not)?  If not, can I grab the level of the active page before I start iterating through the levels in the template?

 

thanks,

Rachael Kreisler

John Mitchell
Posts:3040


04/12/2008 6:27 PM  

I'll need a little time to figure this all out, but I think it can be done.

You could set the Level range dynamically in your skin like this:

< script runat="server">

PrivateSub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
Nav.Level = PortalSettings.ActiveTab.Level.ToString &"-99"
End Sub

< /script>
The Nav id will need to correspond to your menu ID.
There is a token for templates called {ActiveTab.Level}
You may be able to accomplish what you want by starting with the ActiveResetHover 
example which uses javascript to tie to different menu instances together.
All you would need to do is set a fixed width on it in CSS to make the child menu vertical.
Then on the child menu you could use Show="WithActiveParent" 
Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >CSS NavMenu > Show Cohorts and Children of Active Page



ActiveForums 3.7
Powered by: Snapsis Software