Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 10:57 AM
Eric
Guest
 
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.


  #2  
Old July 17th, 2005, 10:58 AM
justin.shreve@gmail.com
Guest
 
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.

  #3  
Old October 12th, 2005, 09:33 PM
Newbie
 
Join Date: Oct 2005
Age: 32
Posts: 1
Default

I've been looking for something similar. See I pretty much design a "template" then call certain information such as content, title, and navigation.

Placed before <html> on index.php in root (this is my template file).
Expand|Select|Wrap|Line Numbers
  1. <?
  2. $fullPath = '/home/traeonna.com/public_html/ayablue';
  3. $dir = $_GET['dir'];
  4. $page = $_GET['page'];
  5. if(!isset($dir)) {
  6.  $dir = 'home';
  7.  $page = 'index';
  8.  }
  9. ?>
  10.  
Here are my includes for content, title, and navigation.
Expand|Select|Wrap|Line Numbers
  1. <? include($fullPath . '/' . $dir . '/' . $page . '.php'); ?>
  2.  
  3. <? include($fullPath . '/' . $dir . '/' . $page . '_title.php'); ?>
  4.  
  5. <? include($fullPath . '/' . $dir . '/' . $dir . '_nav.php'); ?>
  6.  
An example of how the URL looks...
http://ayablue.traeonna.com/index.php?dir=portfolio_amanda&page=fb_sa

I would like a breadcrumb as such...
Home > Amanda's Portfolio > Fruits Basket - Ayame Sohma

It seems that all the breadcrumb stuff I've found will not work with this current system. I'm sure there's a way around this, but I'm just not that well versed in PHP.
 

Bookmarks

Thread Tools

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

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles