The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ASP Programming
|
site navigation
Discuss site navigation in the ASP Programming forum on Dev Shed. site navigation ASP Programming forum discussing Active Server Pages coding techniques and problem solving methods. Use VBScript or Jscript to make dynamic web applications.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 1st, 2003, 08:43 AM
|
|
Contributing User
|
|
Join Date: Sep 2000
Location: USA
Posts: 226
Time spent in forums: 2 h 40 m 35 sec
Reputation Power: 13
|
|
|
site navigation
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.
|

May 1st, 2003, 10:48 AM
|
|
Contributing User
|
|
Join Date: Sep 2001
Location: NJ
Posts: 428
  
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 15
|
|
|
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.
|

May 1st, 2003, 11:02 AM
|
|
Contributing User
|
|
Join Date: Sep 2000
Location: USA
Posts: 226
Time spent in forums: 2 h 40 m 35 sec
Reputation Power: 13
|
|
|
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?
|

May 1st, 2003, 11:38 AM
|
|
Contributing User
|
|
Join Date: Sep 2000
Location: USA
Posts: 226
Time spent in forums: 2 h 40 m 35 sec
Reputation Power: 13
|
|
|
nevermind
Figured it out. Thanks for the suggestion.
<html>
<head>
<title>Untitled</title>
<%
dim NavArray(5,1)
dim id
id = Cint(Request.Querystring("id"))
if id = "" then
id = 0
end if
For navcount = 0 to 1
if navcount = id then
NavArray(3,navcount) = "ffffff"
else
NavArray(3,navcount) = "cc0033"
end if
Next
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
%>
</head>
<body>
<table width="200" cellspacing="0" cellpadding="0" border="0">
<% For i = 0 to UBound(NavArray, 2) %>
<tr>
<td width="200" bgcolor="#<%= NavArray(3,i) %>"><a href="<%= NavArray(1,i) %>?id=<%= NavArray(4,i) %>"><%= NavArray(0,i) %></a></td>
</tr>
<% Next %>
</table>
</body>
</html>
|

May 1st, 2003, 12:03 PM
|
 |
Second highest poster :p
|
|
|
|
|
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.
|

May 1st, 2003, 12:10 PM
|
|
Contributing User
|
|
Join Date: Sep 2000
Location: USA
Posts: 226
Time spent in forums: 2 h 40 m 35 sec
Reputation Power: 13
|
|
|
yes
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.:
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|