Jump to content

Dynamic Breadcrumbs


pkirsch

Recommended Posts

Hello Everyone!

 

I am having troubles trying to figure out how to make a Dynamic Breadcrumbs trail! Yes I have indeed searched Google and I haven't found any really good ways to do this!

 

This is really annoying! Please Help Me with ideas on how to make this possible!

 

Thank You So Much For Your Time!  :D

Link to comment
Share on other sites

I don't Have any code yet! Thats the problem! I need help with the concept of making a Dynamic Bread Crumb Trail!

 

But if you want some code Here's some sample code I've found on the Interweb!

 

-----------------------------------------------------------------------------

 

<?

$ul_id='crumbs';

$bc=explode("/",$_SERVER["PHP_SELF"]);

echo '<ul id="'.$ul_id.'"><li><a href="/">Home</a></li>';

while(list($key,$val)=each($bc)){

$dir='';

if($key > 1){

  $n=1;

  while($n < $key){

  $dir.='/'.$bc[$n];

  $val=$bc[$n];

  $n++;

  }

  if($key < count($bc)-1) echo '<li><a href="'.$dir.'">'.$val.'</a></li>';

}

}

echo '<li>'.$pagetitle.'</li>';

echo '</ul>';

?>

 

 

 

Then Wherever You want it to appear:

 

 

<?

$pagetitle="Insert Page Title";

include("http://www.yourdomain.com/breadcrumbs.php");

?>

 

------------------------------------------------------------------------

 

 

 

Now this seems like it would work well but will it automatically insert the Page Name?

Because i want to have this code (or something similar; can you suggest any good Bread Crumbs Scripts?) in a separate file, then I will include() it in the target page!

 

What do I need To do?

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.