March 25th, 2003, 09:24 AM
Including Menu In Certain Directories
I'm including a template on all pages in a site. In the template I have a menu. What I'd like is to have a different menu displayed if I'm in a different directory.
Something along the lines of:
If path is /mainsite Then
If path is /admin Then
Just not sure about how to go about getting there. My first thought was to use the PATH_INFO server variable, but that returns the page name too.
March 25th, 2003, 03:33 PM
For getting a path use server.Mappath()
depending how you setup your website you can also use server side inludes
The virtual include will require extra server setup to work properly
March 27th, 2003, 02:56 AM
you could also use the
which will give a full path of the current page, starting at the root of the server "/" and you could use that to parse it and put all the if staments that u want
I hope this is of any help.
March 28th, 2003, 03:54 PM
Looks like I really need to practice my If Then Statements. I'm trying to do this without a page name, because there are many pages in each directory.
Although not the exact method I hoped to use, I did get the intended effect by just creating a variable called ShowMenu, then setting that to 1 on each page I want the menu to display on.
If you could show me a better way than I've done, it would be appreciated. Thanks again for your suggestions.
April 1st, 2003, 02:42 AM
Try this code on for size.
strPath = lcase(Request.ServerVariables("SCRIPT_NAME"))
intPos = Instr(1,strPath,"/admin/")
If intPos > 0 Then