November Happy Hour will be moved to Thursday December 5th.

Adding menu items dynamically

Vote:
 

Hello all,

I have the following structure in my web app:

home
|
|- page1
|     |-subpage1
|     |-subpage2
|
|- page 2
 
The menu control is on the masterpage and gets child pages (as in the public templates) and so displays |page 1|page 2| on the menu.

I would like that when the user navigates to 'page 1', the menu display |page 1|page 2|subpage1|subpage2|. i.e. display the current pages child pages also as well as the child pages of the main start page already being displayed.

any help would be much appreciated

Thanks
mlaies

#40585
Jun 14, 2010 14:31
Vote:
 

From what I can see that is actually very similar to the typical main menu - sub menu concept used in the public templates (sub menu starting point set by a dynamic property on each first-level page). Placing the submenu side-by-side with the main menu shouldn't be technically different, it should basically be possible to do with CSS only.

If for some reason the CSS path isn't good enough, look again at the main menu in the public templates where a page loader callback is used to put the start page in the menu. You can do something similar to insert the level-2 pages in the end of the PageDataCollection based on a dynamic property set on the level-1 pages.

A third way could be to use a pagetree and the extra templates there, but I think it could be tricky as you wish to place the level-2 pages last.

#40587
Jun 14, 2010 15:03
Vote:
 

Thank you very much. Thats very helpful

#40635
Jun 14, 2010 17:16
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.