pagematch issues

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
UEBen
Super Advanced
Super Advanced
Posts: 34
Joined: Thu Mar 27, 2003 8:26 pm
Location: Evansville, IN
Contact:

pagematch issues

Post by UEBen »

On our development site (sorry, no URL), I'm trying to implement the pagematch property.

It works great with URL's with page names like "\dir1\index.htm" or "\dir1\dir2\index.htm", however for links to root directories, such as "\dir1\" or even "\dir1\dir2\", pagematch is too smart (or not smart enough).

For example, when on this page: "\dir1\dir1\" the link for "\dir1\" in the menu is highlighted. This is un-wanted.

Can this property be modified/tweaked somehow so that the pagematch property matches (distinguished) directories (without having to specifify the actual page name - as our site is built dynamically by a CMS)?

If not, no biggie.

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

Post by Ruth »

It's very hard explaining pagematch without actually seeing the directory structure for the site and the various pages. So, what do you have pagematch set as that's giving you that match to dir1? It sounds like you have it set as pagematch=dir1; So if you go to the page with that match, then any link on that page that goes to anything in/under dir1 would keep the dir1 highlighted.

Ruth
UEBen
Super Advanced
Super Advanced
Posts: 34
Joined: Thu Mar 27, 2003 8:26 pm
Location: Evansville, IN
Contact:

Post by UEBen »

Ruth,

Since our development site is behind a firewall, I can't show you exactly what I'm talking about, but I'll try to be as specific as I can. (All the following URLs are exact.)

When on the Art page: -www.evansville.edu.edu/prospects/areasofstudy/art/

The link to the "Areas of Study" directory in the menu on the Art page is highlighted.
This is the link to the "Areas of Study" page in the menu: /prospects/areasofstudy/

In the directory for "areasofstudy" I have sub-directories for all of our academic programs (art, biology, math, etc).
It looks kinda like this:

Code: Select all

prospects
--> areasofstudy
    --> art
    --> biology
    --> math
    --> etc.
I hope this is helpful.

To reiterate: the problem is that for any one of my academic program directories, if you are at the home page for that academic program, the link to "Areas of Study" is highlighted in the menu. And this makes sense as the pagematch property has matched the link to the "Areas of Study" home page (/prospects/areasofstudy/) in the current URL on any homepage for any academic program.

But that's just it - I don't want it to! :)

If the method used to match the pagematch property value to the current URL could be tweaked to be more exact, it would help.

Thanks.

-Ben

Here is the menu code used on the Art page:

Code: Select all

with(milonic=new menuname("Side Menu")){
style=SideMenuStyle;position="relative";orientation="vertical";alwaysvisible=1;itemwidth=155;

aI("type=header;text=<img onerror=this.src='/images/linkboxpics/prospects.jpg' src='/images/linkboxpics/art.jpg' height='115' width='155' alt='Art' title='Art'>;padding=0;separatorcolor=black;separatorsize=1;");

aI("text=Art;title=Art;url=.;offbgcolor=#D02433;offcolor=#ffffff;onbgcolor=#D02433;oncolor=#ffffff;separatorcolor=black;separatorsize=1;align=center;");

aI("pagematch=/prospects/areasofstudy/art/faculty.asp;text=Faculty Profiles;title=Faculty Profiles;url=/prospects/areasofstudy/art/faculty.asp;");

aI("pagematch=/prospects/areasofstudy/art/students.asp;text=Student Profiles;title=Student Profiles;url=/prospects/areasofstudy/art/students.asp;");

aI("pagematch=/prospects/areasofstudy/art/alumni.asp;text=Alumni Profiles;title=Alumni Profiles;url=/prospects/areasofstudy/art/alumni.asp;");

aI("pagematch=/prospects/areasofstudy/art/programs.asp;text=Degree Programs;title=Degree Programs;url=/prospects/areasofstudy/art/programs.asp;");

aI("pagematch=http://art.evansville.edu/;text=Art Department Web Site;title=Art Department Web Site;url=http://art.evansville.edu/;target=_blank;");

aI("pagematch=/prospects/areasofstudy/;text=Areas of Study;title=Areas of Study;url=/prospects/areasofstudy/;showmenu=areasofstudy2;");
}

drawMenus();

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

Post by Ruth »

I'm sorry, I know this must be frustrating, and I guess my mind is just not functioning because I can't seem to grasp what it is you want it to not do or do given you have specified a particular pagematch.

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Ben,

Couple of questions.

(1) Are you generating your js menu code dynamically for each page using .asp, or is that Side Menu code the same on each page?

(2) In the menu code that you posted for the Art page, which menu item or items, if any, would you like to be highlighted with the page matching colors etc.?

Cheers,

Kevin
UEBen
Super Advanced
Super Advanced
Posts: 34
Joined: Thu Mar 27, 2003 8:26 pm
Location: Evansville, IN
Contact:

Post by UEBen »

Hi Ruth, I'll try to explain it again.

The purpose for the pagematch property (feature), as I understand it, is to highlight the particular menu item that matches the current page's URL. So if I am on: "/prospects/areasofstudy/art/alumni.asp" then the menu item for the link entitled "Alumni Profiles" is highlighted, as the link in the menu to "Alumni Profiles" is: "/prospects/areasofstudy/art/alumni.asp" and this matches the current URL. This works perfectly.

However, when I'm on the homepage for Art (or any page under Art): "/prospects/areasofstudy/art/" the menu item for the link entitled "Areas of Study" is highlighted (which has a link URL of "/prospects/areasofstudy/") - this is unwanted. "Areas of Study" should not be highlighted since I am not on the homepage for "Areas of Study".

I hope this helps.

---

Hi Kevin.

Yes, all the menu's for the entire site are generated dynamically from a database (as all the content for the site is stored in a database).

It's easier to tell you what I don't want highlighted. In the Art menu, for example, I do not want "Areas of Study" highlighted. Again, pagematch works as it should when it actually matches page names in the menu links (i.e. /prospects/areasofstudy/art/alumni.asp, /prospects/areasofstudy/art/students.asp, etc.) with the page names in the URL.

However if you don't specify a page name (for example "index.asp") for menu links to other directories in the URL path, the pagematch property doesn't make the distinction (between links to root directories or subdirectories) and thus will highlight any menu item matching the URL path sans page name.

WHEW! This is tough to explain. I managed to arrange to have our dev site made available to the public, take a look: http://192.195.225.90/prospects/areasofstudy/art/

Since it's my development site, pages may look broken and messed up or even inaccessible sometimes (I'm sure you understand).

Thanks!!!

Ben
UEBen
Super Advanced
Super Advanced
Posts: 34
Joined: Thu Mar 27, 2003 8:26 pm
Location: Evansville, IN
Contact:

Post by UEBen »

*bump*

Hi Ruth and Kevin. Do either of you have any additional thoughts/suggestions about this? Can anything be done about it?

Always grateful,
Ben
UEBen
Super Advanced
Super Advanced
Posts: 34
Joined: Thu Mar 27, 2003 8:26 pm
Location: Evansville, IN
Contact:

Post by UEBen »

I found a way to "fix" it, sort of: I just specified the actual root page page name for each directory (area of study).
For example: /prospects/areasofstudy/art/index.asp

Although this may cause minor management problems with our CMS and also cause historical linking problems after we convert the site from ASP to Coldfusion, it does work.

Now I need to decide if it's even worth it to use the pagematch feature.... ;)

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

Post by Ruth »

I was just starting to answer this. I'm glad you found something because I haven't any idea how to do a match and leave out the areasofstudy since that is part of the url.

Ruth
Post Reply