1
jsimon
Breadcrumb navigation?
  • 2006/9/7 7:53

  • jsimon

  • Just popping in

  • Posts: 2

  • Since: 2006/9/7 7


How do I do 'breadcrumb' navigation in Xoops? As in http://en.wikipedia.org/wiki/Breadcrumb_%28navigation%29

2
christian
Re: Breadcrumb navigation?
  • 2006/9/7 8:33

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


welcome

The Smart modules (smartsection, smartfaq, smartpartner, etc..) use breadcrumbs automatically.

Cheers!

3
jsimon
Re: Breadcrumb navigation?
  • 2006/9/7 9:45

  • jsimon

  • Just popping in

  • Posts: 2

  • Since: 2006/9/7 7


Aha! Interesting. Downloading SmartSection now - looks like it might do what just what I want.

4
jayjay
module breadcrumbs with cookies and url name
  • 2007/8/29 7:47

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


Howdie all!

I was looking for a way to display breadcrumbs in the old phpwiki XOOPS module. I had already done a pagetitle hack and I thought it would be interesting to reuse this information in a breadcrumb.

I was looking for a quick solution using php and cookies and I quickly stumbled on this solution for history breadcrumbs.

This is what I did in phpwiki:

Make a breadcrumbs.php file in the module root with this content

<?php
/*
Copyright Justin Whitford 2006.
  http://www.whitford.id.au/
Perpetual, non-exclusive license to use this code is granted
on the condition that this notice is left in tact.
*/
$trailLength=5;
$staleCrumbList = explode('|',$_COOKIE['breadcrumbs']);
if ( 
      
$_SERVER['REQUEST_URI'].'!'.$pageName !=
      
$staleCrumbList[count($staleCrumbList)-1]
   ){
  
$crumbList;
  
$startPoint=(count($staleCrumbList) < $trailLength+1)?0:1;
  for(
$i=$startPoint;$i<count($staleCrumbList);$i++){
    
$crumbList[$i]=$staleCrumbList[$i];
  }
  
$crumbList[count($crumbList)+1]=$_SERVER['REQUEST_URI'].'!'.$pageName;
  
setcookie('breadcrumbs',join('|',$crumbList),0,'/');
  
$_COOKIE['breadcrumbs']=join('|',$crumbList);
}

function 
breadcrumbs(){
  
$crumbList = explode('|',$_COOKIE['breadcrumbs']);
  
$returnString = '';
  for(
$i=1;$i<count($crumbList)-1;$i++){
    
$crumb=explode('!', $crumbList[$i]);
    
$returnString .= "<span id='bc$i' class='crumb'>"
      
."<a href='$crumb[0]'>$crumb[1]</a> &rarr; </span>";
  }
  
$crumb=explode('!', $crumbList[count($crumbList)-1]);
  echo 
$returnString.$crumb[1];
}

?>

Add this code in html.tmpl before printf
if($_SERVER['REQUEST_URI'] == '/modules/phpwiki/' || $_SERVER['REQUEST_URI'] == '/modules/phpwiki/index.php'){
$pageName = 'Bestuur';}
else {
$pageName = preg_replace('(/modules/phpwiki/index.php?pagename=(.*))', '$1', $_SERVER['REQUEST_URI']);
$pageName = ucfirst(ereg_replace('%20', ' ', $pageName));}
include (
$_SERVER['DOCUMENT_ROOT']  . '/modules/phpwiki/breadcrumbs.php');

Add this code in top.tmpl under <?= $HEADER ?>
<?php breadcrumbs(); ?>

You can see the result on the Stad Sint-Niklaas website.

I'm posting this here because this solution may be useful to module developers that use intuitive SEO url's.