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
https://forums.phpfreaks.com/topic/43361-dynamic-breadcrumbs/
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
https://forums.phpfreaks.com/topic/43361-dynamic-breadcrumbs/#findComment-210781
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.