Forum Moderators: coopster

Message Too Old, No Replies

In need of a good breadcrumbs script

Good usability and spiderable?

         

stuntdubl

7:54 pm on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey all,

I am looking for a breadcrumbs script that will do a few things, and wonderin' if someone had a good one lying around.

Here goes....
It needs to pull from the location bar and parse the url, BUT I would like to use a hidden form in my individual pages to write the title (instead of using the normal <title> tag)

I would prefer to do it with php (will it be spiderable then?) but I am very weak at scripting. I would also like to call the script from an external location if possible.

I am pretty in the dark here, so any help would be appreciated.

I love the usability (and potential spiderability) of breadcrumbs, but for a non-programmer, they have proved to be quite a pain in the butt (at least for me to customize to fit my application.)

Thanks in advance.

hakre

8:19 pm on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi stuntdubl,

i don't get the word 'breadcrumbs' in the right way i think. can you give a short description of the meaning?

- hakre

stuntdubl

8:30 pm on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry for the lack of clarification.....

The navigation structure at the top of a webpage telling you where you are on the site.....

Home/ForumsIndex/TheWebmasterworld/etc/etc/ Title Goes Here

This is giving me fits today.

I guess javascript would probably be easier since I would have to change all my page extensions to .php but ideas on this would be greatly appreciated.

hakre

8:40 pm on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



stuntdubl: ok i get the point. javascript maybe a quickier solution for you and an application of js i had never used it before.

it should be possible to use the document.location object for this to get the querystring and document.title should do the trick for the page title.

with document.write you can place it on top of each page, but every page has to be changed for this, too (like with php) but there is no need to migrate to php at all.

mabe this is then something for the javascript forum here ;).

stuntdubl

11:36 pm on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I have tried [url="http://www.mickweb.com/javascript/tutorials/breadcrumbs/tutorial.html"]this javascript[/url]
But it seemed to me you had to tell it how many levels deep you wanted it to go (mine may be 3, 4, or 5)

While I was trying to figure that out, I thought it might be better to do in php since then the links might be spiderable by google (would they?) and the linktext would count as well.

I am using hiddenform.pagetitle.value
to pull the value I put in the hiddenform field named "pagetitle". This was the only element I could think of to pull from so I could name my breadcrumb differently than the actual <title> (since the <title> is very long and SE optimized).

I'm kinda just searchin' for that peak cross between form (usability) and function (search engine friendliness)

I will probably go for the .js on this project, but does anyone have a good idea of what the code would be like for PHP? I think it would be great to know for future projects, and a good piece of code that could be recycled.

One last question.....can php scripts be run as externally linked files like javascripts? Bigtime Noob here.

hakre

12:44 am on Jul 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I thought it might be better to do in php since then the links might be spiderable by google (would they?)

yes, they would. javascript links won't.

can php scripts be run as externally linked files like javascripts?

yes, you can write a script in one file and then include() [php.net] it. the difference (and defenetly a pro) is, that the scripts will be executed on the server not in the browser (like javascript).

-hakre

Marcia

12:49 am on Jul 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use php includes and have html pages parsed. It's something you do in .htaccess if you have it available. In fact, it's a good idea to do if you have different breadcrumb navigation for different sections of the site.

The trouble with using Javascript is that search engines like those breadcrumb trails. Regular html code is a lot more practical - unless it's just there for visitors and you don't want it picked up for some reason.

stuntdubl

3:47 pm on Jul 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP would be an awesome way to do the breadcrumbs! I would love the additional spider food, and it would be even cooler if I could call an external script.

The problem is....I have no idea where to start....I don't know squat about PHP (although it is running on our in- house linux/apache server). The only thing I have ever done in php is a small form script.

Does anyone have any good starting points/ tutorials that would get me movin' in the right direction?

As much as I would LOVE to learn PHP, I know the learning curve is high, and I really don't have the time. Just need to hack out a script that I can recycle throughout different sites.

pixel_juice

3:51 pm on Jul 18, 2003 (gmt 0)

10+ Year Member



There's a fairly simple (and well commented) PHP breadcrumb script here - [websitecode.com...]

Note that this script works by looking at the file name and path in order to display the navigation (much the same way as dmoz does).

So if your page was www.domain.com/green_widgets/fluffy-green-widgets.php you can get the script to display something like this:

Home>> Green Widgets>> Fluffy Green Widgets

Although this might be difficult with existing sites, I found this kind of structure when building a site is good anyway.

jamie

4:07 pm on Jul 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi stuntduble,

i recently had to do the same for our site and had a lot of help from the following tutorials:

[hotwired.lycos.com...]

[digi-fx.net...]

[zend.com...]

i know grahamstewart wrote a script for doing this as well in the php bag of tricks on this site [webmasterworld.com...]

good luck

hakre

2:51 pm on Jul 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jamie, thanks for collecting the various articles here ;). for breadcrumpbs i especially like the one on zend.