Highlight of current page in menu

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/7/2007 7:02:44 AM
Gravatar
Total Posts 488

Highlight of current page in menu

If current page is non-cms page (just an aspx that inherits mojoBasePage), the first page in menu is highlighted as it is current.

It would be nice not to highlight any menu page in this case.

6/18/2007 4:10:46 AM
Gravatar
Total Posts 488

Re: Highlight of current page in menu

Thanks for the solution implemented!

Just some questions and remarks.

 

1. As I can see, you have added SuppressMenuSelection() function call to nearly all the portal's non-cms pages (forgot to /Secure/ChangePassword.aspx, Secure/UserProfile.aspx, maybe somewhere else).

Do I need to add it to all my custom non-cms pages?

If so, why not calling it from mojoBasePage (something like if (!this.IsCMSPage) SuppressMenuSelection();)?

 

2. When adding non-CMS page to menu, in this solution it will not be highlighted. It would be nice if it is.

6/18/2007 6:46:43 AM
Gravatar
Total Posts 18439

Re: Highlight of current page in menu

1. Change Password and User Profile don't show the menu so the call is not needed.

The basic issue is that there is always a "CurrentPage" and the menu wants to show it as selected. The Url rewriting masks that the actual urls are like Default.aspx?pageid=x

If page id is incorrect or not specified in the url then the default page will always be returned by CurrentPage. So if someone is manipulating the url they will just get the home page.

So the menu doesn't know whether it is on a CMS page or not, it just wants to select the CurrentPage.

Pages that do not want this to happen should call this method to suppress the default behavior.

Note that not all non-cms pages need this suppresion, PageSettings.aspx and PageLayout.aspx are actually using the CurrentPage and it is appropriate for the menu to be selected at the CurrentPage

2. Might be nice but might also have a high ratio of effort to benefit, not a priority for me.

Joe

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