Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Breadcrumbs

Status
Not open for further replies.

sila

Technical User
Aug 8, 2003
76
GB
Can anyone tell me how I go about creating breadcrumb trails on my website? If possible I'd like to do this in HTML only i.e. not javascript etc.

thanks.
 
sila,

If you mean that you want to do statistics on page-requests from your server, then you have to

1. ask your provider for stats (often a free service on site you pay for)

... or ...

2. include a server side script to log stats

It cannot be done with client side scripts (HTML nor JavaScript). Sorry.

Try the PHP forum for more help!

Good luck


Jakob
 
"If you mean that you want to do statistics on page-requests..."

No he doesn't. He means (I think) a trail to show the user how they got to a particular page and/or where it sits in a hierarchy. Like the

Home > Forums > Programmers > Languages > HTML and CSS (Cascading Style Sheets) Forum

near the top of this page.

How to do it? Depends where your pages are coming from and how they're organised. Care to tell us a bit more?

-- Chris Hunt
 
Chris Hunt is correct in his definition. I cannot think of anyway to create breadcrumbs inpure HTML. You will have to use some scripting, which is not as scary as it sounds. Here are 3 good articles.

How to create breadcrumbs using PHP:
Or in Perl:
Or in ASP:



When in doubt, deny all terms and defnitions.
 
Thanks. Yes it is this type of breadcrumb I'm looking for:
Home > Forums > Programmers > Languages > HTML and CSS (Cascading Style Sheets) Forum

My pages are all HTML (no JS, PHP involved). I have a navigation bar with a number of subsections and just want to make it clear to the user where they are in the hierarchy, I realise it may not be possible in HTML alone(as Jakob's note) but if anyone knows otherwise...

thanks.
 
If all your pages are HTML, static pages, you can always just put static breadcrumb in individual page. I guess this the easiest solution. For static site, I won't bother to have the breadcrumb generted dynamically.
 
Static breadcrumbs are the easiest solution, but also very tedious. Of course, that is the obvious way to do it using only HTML.

When in doubt, deny all terms and defnitions.
 
Well, if you've just got flat pages, can't you just hard-code the breadcrumb trail into the right place on each page? It might not reflect the path the visitor actually took to get to that page, but it doesn't need to (that's what the back button's for). After all, I don't suppose many of us got to this page via the "Home", "Forums", "Programmers" and "Languages" pages did we?

You could then code the HTML as simply as this (for example):
[tt]
<a href=&quot;/&quot;>Home</a> &amp;gt;
<a href=&quot;section1.htm/&quot;>Section 1</a> &amp;gt;
<a href=&quot;sub2.htm/&quot;>Subsection 2</a> &amp;gt;
This page
[/tt]
(though there are much slicker ways to encode it using CSS, using a rearranged <ul> if you want to be really swanky)

-- Chris Hunt
 
CSS? Now that sounds good. I'm just getting into using these. Please tell me more!

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top