Solved

Dynamic Include Navigation with ASP

Posted on 2006-06-29
8
785 Views
Last Modified: 2013-11-18
I see that NAVECHA has answered a query on this one but I got a little lost.

I have a simple navigation include file - ET2Nav.asp
Quote
<A href="et2Ware.asp">Warehousing & Storage </A>:
 <A href="et2vip.asp">VIP customers : </A>
 <A href="et2trans.asp">Transport Broking:</A>
  <A href="et2contact.asp">contact us</A>
Unquote
and what I am trying to do is ensure that when the Warehousing & Storage page - et2Ware.asp - opens up, the link to Warehousing and Storage does not show onthe nav bar.
Is that possible, or can it be highlighted?

kind regards

Misafi
0
Comment
Question by:Misafi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 4

Expert Comment

by:dukestaTAI
ID: 17011608
Here is one method you mayb have to modify it but this should get you started.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
      <title>Untitled</title>
      
<%

Function adjMenu(strLink)

If strLink = request.servervariables("url") Then
      response.write("style='visibility: hidden;'")
End If

End Function


%>
      
</head>

<body >

<A href="et2Ware.asp" <%adjMenu("/et2Ware.asp")%>>Warehousing & Storage </A>:
 <A href="et2vip.asp" <%adjMenu("/et2vip.asp")%>>VIP customers : </A>
 <A href="et2trans.asp" <%adjMenu("/et2trans.asp")%>>Transport Broking:</A>
  <A href="et2contact.asp" <%adjMenu("/et2contact.asp")%>>contact us</A>


</body>
</html>
0
 

Author Comment

by:Misafi
ID: 17012321
Thanks dukestaTAI
The links work but they still all show up - so ther is no difference from the original script.

rgds

Misafi
0
 
LVL 4

Expert Comment

by:dukestaTAI
ID: 17012356
Run this page and tell me what it says for URL: on the page.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
     <title>Untitled</title>
     
<%

Function adjMenu(strLink)

If strLink = request.servervariables("url") Then
     response.write("style='visibility: hidden;'")
End If

End Function


%>
     
</head>

<body >

<h1>URL:</h1><%=request.servervariables("url")%>

<A href="et2Ware.asp" <%adjMenu("/et2Ware.asp")%>>Warehousing & Storage </A>:
 <A href="et2vip.asp" <%adjMenu("/et2vip.asp")%>>VIP customers : </A>
 <A href="et2trans.asp" <%adjMenu("/et2trans.asp")%>>Transport Broking:</A>
  <A href="et2contact.asp" <%adjMenu("/et2contact.asp")%>>contact us</A>


</body>
</html>
0
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 

Author Comment

by:Misafi
ID: 17012442
This is what it came up with - Ensign is the project name
URL:
/Ensign/url.asp Warehousing & Storage : VIP customers : Transport Broking: contact us

rgds
Misafi
0
 

Author Comment

by:Misafi
ID: 17035019
What happens now? I am not sure whether this question has been abandoned on not.
0
 
LVL 29

Accepted Solution

by:
rdivilbiss earned 250 total points
ID: 17047356
>What I am trying to do is ensure that when the Warehousing & Storage page - et2Ware.asp - opens up, the link to Warehousing and Storage does not show onthe nav bar.

Since you are working with ASP, I would suggest an ASP solution.

In the menu include file, you may determine which page is loaded using the server variable, "SCRIPT_NAME" You can then test for the current page and not write it's menu link (or highlight it, etc.)

See my live example at http://www.rodsdot.com/ee/aspConditionalMenuLinks1.asp

ASP code for an example menu include file.

<%
' a variable to hold the currently loaded ASP page name.
Dim pageName

' get the page name from the server
pageName = Request.ServerVariables("SCRIPT_NAME")

' remove any preceding path
pageName = Mid(pageName, InStrRev(pageName,"/")+1)

' write a link only if it is NOT to this page.
if pageName <> "aspConditionalMenuLinks1.asp" then
      response.write "<a title=""ASP Conditional Menu Links Example Page 1"" href=""aspConditionalMenuLinks1.asp"">ASP Conditional Menu Links 1</a>&nbsp;|&nbsp;"
end if
if pageName <> "aspConditionalMenuLinks2.asp" then      
      response.write "<a title=""ASP Conditional Menu Links Example Page 2"" href=""aspConditionalMenuLinks2.asp"">ASP Conditional Menu Links 2</a>&nbsp;|&nbsp;"
end if
if pageName <> "aspConditionalMenuLinks3.asp" then      
      response.write "<a title=""ASP Conditional Menu Links Example Page 3"" href=""aspConditionalMenuLinks3.asp"">ASP Conditional Menu Links 3</a>"
end if
%>

You can improve on my code, but this should show you what is possible.

Regards,
Rod
0
 

Author Comment

by:Misafi
ID: 17048411
Perfect ! - thank you very much

Regards

Misafi
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 17050884
Glad to help. Good luck!
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question