View Full Version : How can I dynamically create a link trail from user's path to current page?

04-24-2004, 08:18 AM
I've found numerous "breadcrumb" script solutions which assume that your link trail represents a hierarchy--the folder structure of your site. I don't want to show the user's path through the folder structure. I need to show the user's path from page to page while within the site. This is necessary due to the fact that I reuse a lot of documents, which means the path you might have taken to get to document X can differ, and also means that the folder structure does not mirror the hierarchy of the information.

Here's what I need to be able to do, in plain English:

1) Track how many clicks the user has traveled "down" into the site hierarchy from home page.

2) Store the page title for each page visited.

3) Dynamically write link trail on each subsequent page, using previous page's title for the link text and "javascript:history.go(-n)" for the link.

4) Recognize when user steps back up the link trail (referrer and destination are the same), and don't rewrite link trail on that page.

I think that describes what needs to be done. I'm shocked that I haven't found a script that does this already. Does anyone know of one or have any tips as to how to pull this off?

Thanks in advance for any help you can offer.

Willy Duitt
04-24-2004, 08:36 AM
I have something I have been working on that will satisfy your needs other than the title thing which should not be hard to implement.

P/M me if you would like to make some sort of arrangement.