OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

How to: dynamic sub-menu's?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> How to: dynamic sub-menu's?
Page: [1]
 
pcguy

 

Posts: 137
From: None
Status: offline

 
How to: dynamic sub-menu's? - 4/29/2009 15:13:01   
Hi Folks,

I'm redesigning an ASP site with Dreamweaver CS4, so I'll be sticking to using ASP technology....

The site will use horizontal navigation for the MAIN MENU which will be static, but each page therein will have a vertical sub menu, probably with 2-3 levels deep - which will need to be dynamic.

I'm trying to figure out a good way to organize and maintain the submenus. I need each page to "know where it is" so the breadcrumb trail can be accurate and dynamic. The page/menu will also need to know how to display the correct submenu/level.....hopefully this all can be dynamic....

I also want to avoid query string parameters, such as page.asp?menu=1&submenu=3 type stuff.....

My current thought is to use URL rewriting and a database - but I'm not sure if this is the best route....

Does anyone have any suggestions? HELP!

Thanks!
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: How to: dynamic sub-menu's? - 4/29/2009 16:15:47   
Here is our bit on breadcrumbs:
http://www.texaswebdevelopers.com/blog/template_permalink.asp?id=105
You can get the page you are on by using server variables:
http://www.texaswebdevelopers.com/examples/servervariables.asp
So you can include a menu depending on where the user is:
<% If Request.ServerVariables("HTTP_REFERER") =http://www.yoursite.com/directory/page.asp Then %>
<!--#include file="menu1.asp" -->
<% else %>
<!--#include file="menu2.asp" -->
<% end if %>
All the menu URL's should be Full (long) URL's instead of relative to the page.
This can get kind of kludgy....


_____________________________

:)

Follow us on TWITTER

(in reply to pcguy)
pcguy

 

Posts: 137
From: None
Status: offline

 
RE: How to: dynamic sub-menu's? - 4/30/2009 5:38:12   
Yeah, I can see that getting kind of ugly....especially if you did it for the whole site...

However, it might ok to have a separate include file for each folder below the root - I'll have to play with that...

Thanks for the info...

(in reply to TexasWebDevelopers)
clum1

 

Posts: 778
From: Glasgow, Scotland
Status: offline

 
RE: How to: dynamic sub-menu's? - 5/4/2009 9:29:06   
I've just done something similar with my intranet's menu system; I've used Request.ServerVariables("SERVER_NAME") to create a "root" address for each link and it's cut down a lot of the kludge:

CurrServerName	=	Request.ServerVariables("SERVER_NAME")
RootAddress		=	"http://"&CurrServerName&"/intranet/"


So, for instance, a hyperlink becomes:

<a href="""&RootAddress&"contacts/"" title=""Staff Details"">Contacts</a>


so each actual address is just it's relative path and I can use the same menu for my dev server and production one...

It's been a real boon - previously I had my menu system using FP include files which took an age to update; now one ASP page handles the lot. I played around with the idea of using a database but it didn't really offer me anything. In the end I plugged it into a heavily adapted version of this JS dropdown menu.

_____________________________

kenilweb.com; simple, effective web design

"So I said to the Gym instructor "Can you teach me to do the splits?" He said "How flexible are you?". I said "I can't make Tuesdays"."

Tim Vine

(in reply to pcguy)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: How to: dynamic sub-menu's? - 5/4/2009 11:45:12   
Great idea---but I think it has the same issues when there are multiple sub-webs because you have to specify the name of the subweb directory (your root address) for each sub-web. That by itself might be hard to keep up with. And, I got the impression from the post that "2-3 levels deep" meant sub-webs and sub-sub-webs, etc. rather than different directories in the root which complicates things even more.

_____________________________

:)

Follow us on TWITTER

(in reply to clum1)
Page:   [1]

All Forums >> Web Development >> General Web Development >> How to: dynamic sub-menu's?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts