Or you can cheat like I do and only display the crumbs for the nav bar for the most probable pth the user has taken
The problem with tracking this in a variable is that at some point the user will (hopefully) get 15 clicks into your website, and your crumbs will start to repeat...
and then they will throw your formatting off,
and then they will line wrap,
and then..well, you get the picture.
Tracking probable path over definate path is much easier as you don't need to worry about repeating links and so on.
You can hardcode in all the links and such, but I found it gets to be a pain when you try to change the look of them or the spacing or whatever. Just because I am tired from work and feel like giving away free stuff here is a copy of the object I write at some point to make creating and displaying crumbs a much easier chore:
Code:
Class NavCrumbList
Dim nextCrumbList
Dim myCrumbAddress, myCrumbText
Public Property Let Address(addr)
myCrumbAddress = addr
End Property
Public Property Get Address
Address = myCrumbAddress
End Property
Public Property Let Text(txt)
myCrumbText = txt
End Property
Public Property Get Text
Text = myCrumbText
End Property
Public Function ToString()
If isEmpty(nextCrumbList) Then
ToString = "<a href="""&myCrumbAddress&""">"&myCrumbText&"</a>"
Else
ToString = "<a href="""&myCrumbAddress&""">"&myCrumbText&"</a> » " & nextCrumbList.ToString
End If
End Function
Public Function AddCrumb(addr,txt)
If isEmpty(myCrumbText) Then
myCrumbAddress = addr
myCrumbText = txt
ElseIf isEmpty(nextCrumbList) Then
Set nextCrumbList = New NavCrumbList
nextCrumbList.AddCrumb addr, txt
Else
nextCrumbList.AddCrumb addr, txt
End If
End Function
Public Function GetLastText()
If isEmpty(nextCrumbList) Then
GetLastText = myCrumbText
ElseIf isEmpty(nextCrumbList.Text) Then
If isEmpty(myCrumbText) Then
GetLastText = "Page Error."
Else
GetLastText = myCrumbText
End If
Else
GetLastText = nextCrumbList.GetLastText
End If
End Function
End Class
Here's how it works. First instantiate a copy of it:
Code:
Dim nav
Set nav = New NavCrumbList
Now wherever you want to add a crumb to it in this page you can simply call the nav.AddCrumb(address as string,text as string)
Then when you want to output it just call the toString method. Feel free to alter the formatting in the toString or gnore this object altogether
01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048