Breadcrumb script for ASP site using SSI

I have an intranet site that has about 50 pages of info, links, forms and other misc stuff that I would like to add bread crumbs. For simplicity sake I put the asp pages in the main directory with the include files and the scripts I have found so far just read the path to the file, which of course doesn't work for me.

For example, on the "Request for Leave" form page that has 2 includes (header and footer) and is linked on the "Forms" page (with all the other forms) the bread crumb scripts I have found so far all show "Home > Request for Leave" but I want it to read "Home > Forms > Request for Leave"

I really don't want to hand code all the breadcrumbs but I can't seem to find or write a script that works. How do it?
Bob StoneIT GuruAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob StoneIT GuruAuthor Commented:
I figured it out.
Function BreadCrumb(FullPath)

Do Until instr(1,FullPath,"/") = 0

	'## Create an array of letters in the alphabet.
	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")

	'## split on the /
	tmpPath = mid(FullPath,1,instr(1,FullPath,"/")-1)
	strTmpPath = Trim(tmpPath)
	DirPath = DirPath & strTmpPath & "/"

	'## upshift the first character
	firstLetter = ucase(mid(strTmpPath,1,1))
	strTmpPath = firstLetter & mid(strTmpPath,2,len(strTmpPath))

	'## replace udnerscores with spaces and upshift the following character
	for each letter in letters
		strTmpPath = Replace(Trim(strTmpPath),"_" & lcase(letter)," " & UCase(letter))

	'## split the next one out	
	FullPath = mid(FullPath,instr(1,FullPath,"/")+1,Len(FullPath)-Len(tmpPath))

	'## separate them with >> symbols
	IF strTmpPath = "" THEN
		response.write "<a href=""/"" style=""text-decoration:none"">Home Page</a>"
	ELSEIF strTmpPath = "Home" THEN
		response.write " &gt; <a href=""" & DirPath & """ style=""text-decoration:none"">" & strTmpPath & "</a>"

IF PageTitle = "" THEN
	response.write " &#187; Current Page"
	response.write " &#187; " & PageTitle

End Function %>


In <head> of header file
<!--#include virtual ="/scripts/breadcrumb.asp"-->


On each page where breadcrumbs should go
<% PageTitle = "<a href=""prior page.asp"" style=""text-decoration:none"">Contacts</a> &#187; Places" %>

<% = BreadCrumb(Request.ServerVariables("PATH_INFO")) %>

Which gives me "Home  » Contacts » Places"

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob StoneIT GuruAuthor Commented:
Though I am still not clear exactly how much time that will save from just doing it manually, but I guess the format will be consistent all the way through and if I decide to change the format or something, it will help somewhat.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.