Qim Posted December 14, 2007 Posted December 14, 2007 Hi, I have modified may shop quite a bit now. Still have some issues to resolve. One of these is wrt breadcrumb trail. Please look at my shop and click on a subcategory. Visit My Website On the main page you will se the name of that subcat. The same subcat is in the breadcrumb trail which of course is redundant, and needs to be eliminated. I have changed classes/breadcrumb.php to get the subcat on the main page, which I want. See Code below. Q: What and how, do I change the breadcrumb trail, so that the redundant info is excluded? Many thanks in advance, and happy holidays / Qim <?php /* $Id: breadcrumb.php,v 1.3 2003/02/11 00:04:50 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ class breadcrumb { var $_trail; function breadcrumb() { $this->reset(); } function reset() { $this->_trail = array(); } // start of added code for category/subcategory names function last() { $trail_size = sizeof($this->_trail); return $this->_trail[$trail_size-1]['title']; } // end of added code function add($title, $link = '') { $this->_trail[] = array('title' => $title, 'link' => $link); } function trail($separator = ' - ') { $trail_string = ''; for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) { if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) { $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>'; } else { $trail_string .= $this->_trail[$i]['title']; } if (($i+1) < $n) $trail_string .= $separator; } return $trail_string; } } ?>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.