Breadcrumb Navigation with ASP
Hi all,
Don't know if anyone can help but I'm trying to create and automatic breadcrumb navigation
so that users can see where that are with in the site and where they have been for example:
Your are Here: Home>BR>Helpdesk>Contacts
Here is the code I am using:
First, I place these two lines at the very top of my ASP page--above all other lines of code:
<% PageTitle = "Bread Crumb Example Page" %>
Then I replace the <title> tags with this code:
<title><% = PageTitle %></title>
Then I place this code where I want the bread crumb navigation to appear:
<% = TWDbreadcrumb_navigation(Request.ServerVariables(" PATH_INFO")) %>
Finally, I create an ASP page with ONLY this code in it; naming it "breadcrumb_navigation.asp" and put it into my "includes" folder:
<%
Function TWDbreadcrumb_navigation(FullPath)
Do Until instr(1,FullPath,"/") = 0
Letters =
array("a","b","c","d","e","f","g","h","i","j","k", "l","m","n","o","p","q","r","s","t","u","v","w","x "
,"y","z")
tmpPath = mid(FullPath,1,instr(1,FullPath,"/")-1)
strTmpPath = Trim(tmpPath)
DirPath = DirPath & strTmpPath & "/"
firstLetter = ucase(mid(strTmpPath,1,1))
strTmpPath = firstLetter & mid(strTmpPath,2,len(strTmpPath))
for each letter in letters
strTmpPath = Replace(Trim(strTmpPath),"_" & lcase(letter)," " & UCase(letter))
next
FullPath = mid(FullPath,instr(1,FullPath,"/")+1,Len(FullPath)-Len(tmpPath))
IF strTmpPath = "" THEN
response.write "<a href=""/"" style=""text-decoration:none"">Home</a>"
ELSEIF strTmpPath = "Home" THEN
ELSE
response.write " > <a href=""" & DirPath & """ style=""text-decoration:none"">" & strTmpPath &
"</a>"
END IF
Loop
IF PageTitle = "" THEN
response.write "<b>" & " : Current Page " & "</b>"<br>
ELSE
response.write "<b style=""color: #800000"">" & " : " & PageTitle & "</b>"
END IF
End Function
%>
The only problem is I get this error message and I don't know why!
Error message:
Microsoft VBScript compilation error '800a03ea'
Syntax error
/br/helpdesk/breadcrumb_navigation.asp, line 22
response.write "<b>" & " : Current Page " & "</b>"<br>
------------------------------------------------------^
Help Please.... It's driving me mad!
Thanks in Advance, John :-)
|