![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can DW do this or do I need to hand code this? |
|
Hi All I'm attempting to use a bit of ASP to help with a css driven navigation menu. I have the navigation menu built, but I'd like to use conditional asp to designate where a visitor is in the site. So, sasy my site has the following categories: About Us Products Services Each category has a directory on the server to hold the appropriate web pages: about products services So my nav menu contains 4 items across the top of each page: Home Products Services About Us The nav menu is text and is controlled via css for rollovers etc. What I'd like the asp to do is something like this: % If the server path CONTAINS "products" MAKE the products nav menu item bold IF NOT MAKE the products nav menu item not bold % So when a visitor visits a page within the Products directory, the products nav menu item would be bold. Ditto for About Us or Services. I know I can use the ServerVariable PATH_INFO to get a files location on the server. What I don't know how to do is to create the conditional code. I think I need to have asp read the PATH INFO, determine if the word "products" is in the string and then do the appropriate display. Can DW do this or do I need to hand code this? Any advice is appreciated. dlc |
#3
| |||
| |||
|
|
It's pretty simple to do. Each link in the menu could be something like a href="blah.asp?2" where the '2' is used to specify the button number. Your code in the menu could then parse this number and do an if test to determine which source to use. |
#4
| |||
| |||
|
|
It's pretty simple to do. Each link in the menu could be something like a href="blah.asp?2" where the '2' is used to specify the button number. Your code in the menu could then parse this number and do an if test to determine which source to use. There's really no need to muddy up the URL with query strings in this case. You can read the URL via ASP and see if it contains a phrase within it: Get the URL and assign it to a string: strURL = Request.FilePath Then, use the instr function to see if it contains a word/phrase: InStr(StringBeingSearched, StringSearchingFor) So, if you are looking for the about page: if InStr(strURL, "about") > 0 then set the about link's class to "on" -Darrel |
#5
| |||
| |||
|
|
I still think the CSS is the right way to do it! 8) |
![]() |
| Thread Tools | |
| Display Modes | |
| |