Dynamic pages together with menu system is difficult to handle

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/6/2013 4:40:35 PM
Gravatar
Total Posts 137
When enough isn't

Dynamic pages together with menu system is difficult to handle

Hi,

For a while I have explored the situations when a left-side vertical menu will show or won't. I'm unsure whether I have found a couple of bugs, some unconsidered situations or if this is all for an explainable purpose.

Normally the menu system and options are great. I really like the ways you can joggle with menus, sitemaps, page titles etc. But if you use dynamic pages, e.g. /my-page.aspx?id=4 the menu will often turn off.

Is that really the best to do? I understand this is a page different from /my-page.aspx as I have turned off canonical urls. But would it be possible somehow to maintain menu-highlighting when using different id numbers?

Related to that: The vertical menu also turnes off if the top menu is a link http://www.my-site.com/first-item-in-vertical-menu.aspx and not a page like /top-menu.aspx that redirects to /first-item-in-vertical-menu.aspx. Is that also the best solution?

Best regards
Lars
http://www.boostmarathon.com
http://www.nysport.dk

My setup is this:

What operating system? Windows 8
What database platform? MySql 5.5
What version of mojoPortal? 2.3.9.6 MySQL
What version of .NET? 4.0
Artisteer? 4

 

6/7/2013 7:11:46 AM
Gravatar
Total Posts 18439

Re: Dynamic pages together with menu system is difficult to handle

Hi Lars,

The problems come because you design your custom features in a not recommended way, none of the features I ship have this problem.

You are trying to take shortcuts and do too much of your feature inside the module control. You should not link back to the cms page that contains the module control with extra parameters in the query string and then do dynamic things inside your module control based on those parameters. What if a page has multiple features on it and they all want to do that it will be a big mess with each one stepping on the other one by changing the url parameters. It goes against the grain of the system to design features this way and leads to such problems as you describe.

Instead you should follow the recommended way of implementing supporting pages and then you link to your supporting pages instead of back to the cms page and you pass the pageid and module id as params to your supporting page in addition to any custom params of your own and the menu will stay highlighted. This approach is also better for SEO because you the canonical url for the cms page does not have any of your parameters so it won't be indexed correctly whereas with links to a supporting page google will crawl the link to the new url and you can specify your own canonical url in the head of the page.

You can implement some of your feature in a usercontrol and then embed that usercontrol inside the module usercontrol and then also embed it in a supporting page if you need to re-use similar functionality in both places. You will see we use this approach in some included features if you study the source code.

Hope that helps,

Joe

6/7/2013 9:29:25 AM
Gravatar
Total Posts 137
When enough isn't

Re: Dynamic pages together with menu system is difficult to handle

Thanks, Joe, for the clarification.

I will try to fully understand the logic and consequences of what you outline for me here by spending some more time on it and testing. SEO is no problem though as we have turned off canonical urls in the user.config file. We have three different sites where we got from 3000 to 90000 indexed dynamic pages - that part works really well.

Do you have comment also on the situation where the top-menu is a link rather than a page? It looks like the left menu will turn off then.

Best regards and thanks a lot

Lars

6/7/2013 10:48:16 AM
Gravatar
Total Posts 2239

Re: Dynamic pages together with menu system is difficult to handle

Hi Lars,

You can work-around the issue with an item in the menu being a direct link by using a regular, relative url (~/page-name) in the page settings and then changing the pageid on friendly url entry in the URL Manager to point to the pageid of the page you really want to show up. This will cause a single page to have multiple urls (not ideal for seo) but it would fix your menu issue. Be careful using this approach because of the SEO implications.

HTH,
Joe D.

6/7/2013 10:49:18 AM
Gravatar
Total Posts 18439

Re: Dynamic pages together with menu system is difficult to handle

If you use a link in the menu ie with a fully qualified url it does not make the linked page really have a different parent page it just means you have a link at an arbitrary point in the menu. The Menu highlights only based on the true site hierarchy. It is a limitation of reality that I have no solution for.

It is the same for example on this site we have the Community Downloads page listed under the Community menu but it is really a child page of the Download page not the community page so when you visit that page it does not matter which link you clicked, the real parent page will be highlighted not the fake one.

The menu highlighting happens based on the pageid (which is hidden by url re-writing for cms pages, friendly urls for cms pages map to Default.aspx?pageid=x). The active state of the menu is based on the pageid param in the url. So if you want some particular non cms page to be highlighted when you link to it you need to include the pageid (of the one you want highlighted) in the url to your arbitrary page.

Best,

Joe

6/7/2013 10:59:18 AM
Gravatar
Total Posts 137
When enough isn't

Re: Dynamic pages together with menu system is difficult to handle

All right - thanks, both of you :)

I will explore these suggestions. So far my work around have been to add a true page in the topmenu and then make url-rewrite to the one I had in mind to link to. Then the menu shows up and the SEO should be ok.

Best regards

Lars

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