Highlighting Current Pages

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
kidburla
Beginner
Beginner
Posts: 4
Joined: Mon Aug 14, 2006 9:59 pm

Highlighting Current Pages

Post by kidburla »

Hi, I am considering implementing the DHTML Menu for a rather large menu system being used on a PHP/MySQL-driven site. I am wondering if there is any facility in the software (or plugin for the software) which allows me to highlight the current page the user is on (and its parent(s)) in a similar way to how the menu system on the main Milonic site is done.

One way to do this would be to dynamically re-generate the menu_data file from a database each time the page is loaded. However this is rather time-consuming, especially due to the size of the menu and the fact that this operation would most likely be running more than once at the same time, as different users access the site.

My current idea for an implementation is to have some script which re-generates a static menu_data.js every time the content of the site is changed, which is a lot less often than page loads by users. However this approach would not enable me to implement highlighting as detailed above. I am hoping there is some way to implement "highlighting of the current page" in the actual JavaScript code.

Thanks,

Adam.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

There are menu properties which have page as part of their name i.e. pagebgcolor, pagecolor, pagebgimge, pageimage etc. Those are the 'highlighting -you are here' properties. Below my name are some links to the menu properties style, menu and item. The page one can be both a style property and an item property. Take a look at the Quick Reference guide. Hope this helps.

Ruth
kidburla
Beginner
Beginner
Posts: 4
Joined: Mon Aug 14, 2006 9:59 pm

Post by kidburla »

Okay that's great; pagebgcolor etc. However I now want to ask: is there any plugin/script modification etc, which allows me to modify the way which the current page URL is compared to the URL in menu_data?

I have URLs of the form:

http://somedomain.org/somescript.php?page=foo&show=bar

Now I want to distinguish between "page" variables but not "show" variables.

e.g.
http://somedomain.org/somescript.php?pa ... &show=bar1
http://somedomain.org/somescript.php?pa ... &show=bar2

are classed as the same, but

http://somedomain.org/somescript.php?pa ... &show=bar1
http://somedomain.org/somescript.php?pa ... &show=bar1

are different.

Any way to implement this? I have looked at the JS Source, but it seems obfuscated, to say the least.

Adam.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I'll post to Milonic about this because I have no idea :?

This is not an open source product. You cannot modify/alter the program files. Only the menu_data file is user editable.

Ruth
kidburla
Beginner
Beginner
Posts: 4
Joined: Mon Aug 14, 2006 9:59 pm

Post by kidburla »

Ruth wrote:Hi,

I'll post to Milonic about this because I have no idea :?
Thanks, that'd be great!
This is not an open source product. You cannot modify/alter the program files. Only the menu_data file is user editable.

Ruth
Sorry! I didn't realise that I wasn't allowed to modify the source. I had thought of trying to modify the source code for my needs and then crediting Milonic with the original, but this is clearly not an option. I will not pursue this line of thought further.
kidburla
Beginner
Beginner
Posts: 4
Joined: Mon Aug 14, 2006 9:59 pm

Post by kidburla »

Hi,

Any more news on this?
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

Have you tried the pagematch property?

This should enable you to declare a keyword to force a match.

You could declare this in PHP and pop it into the menus style, something like this:

pagematch="page=foo1";

Hope this helps,
Andy
Post Reply