473,464 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.
Jul 17 '05 #1
2 2896
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.

Jul 17 '05 #2
Traeonna
1 New Member
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.
Oct 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ray | last post by:
I want to put a navigation bar on a page like: <img> Home >> My Family >> My Daughters >> Melissa >> Three-year-old First I used <ul class="breadcrumb"> <li><img src="icon.gif" alt="icon"><a...
2
by: | last post by:
I'd want to make a custom class that will generate breadcrumb navigation for my site via a recursive query, e.g. Home > Page1 > Subpage 1. I've structured my database with hierarchical parent/child...
1
by: TG | last post by:
I would like to know how to create a breadcrumb trail or menue in ASP.NET/VB.NET. Could someone please help me with this? Thank you. TG
3
by: Mark | last post by:
I can envision a situation where I want part of our site to be navigated using a TreeView, and ALL of our site to have a Breadcrumb (SiteMapPath control). Is there a way to maintain a single...
1
by: Mike | last post by:
Hi, I'm a complete newbie to XML and am needing to rush through a job requiring far more knowledge than I have the time to gather. Basically... I need to build a breadcrumb menu for our...
1
by: Red | last post by:
Hi, Can someone give me a starting point, as I can't figure this out myself. I want to create a breadcrumb trail on a site, but instead of being generated by cookies or a directory structure,...
3
by: DBdealer via DotNetMonster.com | last post by:
I'm trying to build a breadcrum navigation bar for my website....please can some one suggest me ways...It's a 100 page site and I need it for navigation with the site....Thank you -- Message...
0
by: Boris Twila | last post by:
How de do? My menu and breadcrumb trail use the sitemap file. I have things in my sitemap that I want to show up in my breadcrumb trail, but not in my menu. How to do?
0
by: xyz | last post by:
It does not seem skmMenu supports a breadcrumb. I was thinking of using the SiteMap class for the breadcrumb. Has anyone done anything like this? My potential designs are: 1. Using menu.sitemap...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.