Does anyone know of a good solution for maintainable navigation? We are redesigning a huge site for a large energy company. This site has a ton of navigation links in the left menu. There are primary, secondary and tertiary levels. When you are on a particluar page, the navigation associated with it is in the "at" condition. I don't think I can use a menutree because each link goes to a different page.
The only think I can think of doing is this:
I was thinking about creating a navigation include for each main section of the site. This include would include every combination of primary, secondary and tertiary nav for that section. Each nav element would be called with variables passed through the querystring. The at and off conditions would also be called this way. However, it would be driven by a ton of if then statements.
My goal is for the user to not have to update a bunch of pages each time the navigation scheme changes. They should be able to make one adjustment which effects the navigation throughout the site. Is there a better way to do this?
Thanks for the help.
There is a way to do this without using asp and if you are willing to spend some $. If you set the site up in dreamweaver with templates then you can maintain the menu's and simply change the template file and all your menu's will change. There is also a product called contribute which is a stripped down dreamweaver for content editors without any HTML knowledge. You can set up all the styles and templates and allow them to add content and pages. Then you can still go into dreamweaver and update it.
If you want to go the asp route then is the navigation going to be the same on every page? or will it be different. I didn't quite understand what you were saying. From what i can tell you want the menu item to look a little different based on what page you are on. If i were you i would make the a functino called makeMenu and pass in the current page. Then you can adjust that menu item accordningly. And it doesn't have to be tons of if/then statements. You can keep your menu items in an array and loop through the array, checking for the value that you passed in.
thanks for the reply
Thanks for your feedback -
Dreamweaver is not an option. I have to go the ASP route. Your idea is good, however I really don't know how to implement an array for this situation.
The navigation will apprear slightly different on each page. The navigation will be in an "at condition" when you are on that page. Typically this will be the link with a white background behind it. All navigation is textual. Also, depending on whether you are on primary, secondary or teritiary page, a different bullet will appear next to the navigation.
Is it possible to determine which level of navigation (primary, secondary or tertiary) you are on for the background color and text color of the link, which bullet to place next to the link and how far to indent the link based on an array?
Figured it out. Thanks for the suggestion.
id = Cint(Request.Querystring("id"))
if id = "" then
id = 0
For navcount = 0 to 1
if navcount = id then
NavArray(3,navcount) = "ffffff"
NavArray(3,navcount) = "cc0033"
NavArray(0,0) = "link1"
NavArray(1,0) = "array.asp"
NavArray(2,0) = "primary"
NavArray(4,0) = 0
NavArray(0,1) = "link2"
NavArray(1,1) = "array.asp"
NavArray(2,1) = "primary"
NavArray(4,1) = 1
<table width="200" cellspacing="0" cellpadding="0" border="0">
<% For i = 0 to UBound(NavArray, 2) %>
<td width="200" bgcolor="#<%= NavArray(3,i) %>"><a href="<%= NavArray(1,i) %>?id=<%= NavArray(4,i) %>"><%= NavArray(0,i) %></a></td>
<% Next %>
I personally would advise against ever going with the Dreamweaver templates since all it does is search and replace operations on the files. If someone later comes to edit the site and they don't have Dreamweaver you get problems, I would stick with a solution that works for everyone.
I agree. I have come accross another problem.
In my code above, I am setting the off and at condition based on a variable passed through the querystring. What if a user manually enters a url to a certain page without the variables? The navigation will look like you are on one page while the content is from another. Is there a way to do this without passing variable through a querystring so that will not happen?
I know I know, if its not one thing is another.: