Issue while binding different menuitems for different layouts ( same site )

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
2/14/2013 7:09:00 AM
Gravatar
Total Posts 3

Issue while binding different menuitems for different layouts ( same site )

What we are planning to do is merge all our solutions into a single instance of mojoportal. Earlier,we had four  solutions for different modules with different mojoportal to support each of our solution.

We had customized the layout.master file and the stylesheets for each solution accordingly.

Also, the solution points to different database depending on the modules.

There are different menu items on the landing page by clicking on one of the menu I get navigated to a page which is the main page for the next module.

Now, the problem comes with the menu for the page I am navigated to. The same menu appears for the page even though it is pointing to different master file with different menu items.

To solve this, while building the site map in the class file mojoSiteMapProvider, I have written certain lines of code where it will make the root node null and also clears the nodes so that it gets created again with the new values.

But, in this case, it moves to the OnSiteMapChanged event and makes the rootnode null and clears the nodes that is newly binded and the menu on the new page appears blank

Even if I by pass the clear function it goes in infinite loop and the page is not loaded.

Can you please suggest the solution for the same.

2/14/2013 7:27:37 AM
Gravatar
Total Posts 18439

Re: Issue while binding different menuitems for different layouts ( same site )

No I cannot suggest a solution for your complex problem/goal. But I can say you should not modify any mojoPortal code and if you do that you should not expect any support from me for your forked version.

2/20/2013 7:12:03 AM
Gravatar
Total Posts 3

Re: Issue while binding different menuitems for different layouts ( same site )

For the first time, in the BuildSiteMap method , i get 1728 count in the nodes list.

 

Next, there is a check made in the method that if the rootnode is not null return rootnode. So, this value is returned again because of which i get the same menu wherever i am navigated to the page on clicking any menu items.

 

So, I am actually checking the page url in the BuildSiteMap method and based on that i am making the root node null and clearing the nodes list and later after clearing it it doesn't go in the not null condition and binds the new list after which i  get count 65 but still because of the Clear method , it becomes 0 .

 

The menuitem bind method is called in the SiteMenu.ascx control but because of the count 0 it binds nothing and menu appears blank.

 

Hoping to get some help. 

2/20/2013 9:35:04 AM
Gravatar
Total Posts 2253

Re: Issue while binding different menuitems for different layouts ( same site )

Hello,

Support will not be provided for forked code. Honestly, it sounds like you've overcomplicated the menu on your site.

If I understand your requirements, you need to have a different menu on different pages of your site. If that's the case, you can easily build your own menu using the list module or even just html content. You could then build as many of these "menus" as you would like, one module instance for each menu, and using the "Global Content" feature, place those menus on the appropriate pages. To place the menus in the header of your site, you'll need to move AltContent1 to the header and then place the menu module instances in the "Top Content" pane.

The solution I outlined above will not fork the code and you could have it finished in a matter of minutes.

HTH,
Joe D.

2/20/2013 10:10:32 AM
Gravatar
Total Posts 18439

Re: Issue while binding different menuitems for different layouts ( same site )

You could also implement your own sitemapprovider and plug it in instead of modifying the mojoSiteMapProvider, so forking the code is not necessary and is a bad idea. But you also need to understand that the SiteMap is heavily cached by the asp.net runtime and is only invoked when the cache has expired or been cleared.

You could also implement custom menus and add menu items directly from custom code without using a sitemapprovider at all.

But if you make a custom sitemap provider of your own and plug it in it is not our job to provide support or guidance for doing so, just as it is not our job to support forked versions of mojoPortal.

 

You must sign in to post in the forums. This thread is closed to new posts.