breadcrumb classes.

This is a discussion on breadcrumb classes. within the PHP Language forums, part of the PHP Programming Forums category; I am looking for a breadcrumb class in PHP that does not rely on the directory structure to build the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-11-2004
Eric
 
Posts: n/a
Default breadcrumb classes.

I am looking for a breadcrumb class in PHP that does not rely on the
directory structure to build the trail.

I have been using Richard Baskettes -
http://www.baskettcase.com/classes/breadcrumb/ - breadcrumb classes and
they are great... BUT. I have a site that is being built using
templates and the directory hierarchy can not be used to create the
trail.

Sorry if you read this post in alt.lang.php.

Thanks.


Reply With Quote
  #2 (permalink)  
Old 12-12-2004
justin.shreve@gmail.com
 
Posts: n/a
Default Re: breadcrumb classes.

Is a class really needed for breadcrumbs? For my blog navigation (my
weblog script) I simply just use a function that goes along with my
template engine.

Example:

<?php
$output = breadcrumb("{b Index}index.php{/b} {s} {b
Options}index.php?options{/b}", "||");

function breadcrumb($data,$sep) {
$breadcrumb = str_replace("{s}", $sep, $data);
$breadcrumb = preg_replace("#{b (.*?)}(.*?){/b}#s", "<a
href=\"\\2\">\\1</a>", $breadcrumb);
return $breadcrumb;
}


print($output);
?>

Will create a simple breadcrum setup, and you could just display the
navigation depending on the page load (example):

$output = breadcrumb("{b
".$_GET['id']."}index.php?id=".$_GET['id']."{/b}", "||");
Depends on how advanced you want to get.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0