Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Swap my breadcrumbs


dannygoh

Recommended Posts

Posted

Hi,

 

For example my breadcrumbs is look like "Top ? Catalog ? DVD Movies ? Comedy ? DVD-TSAB", can i change to "DVD-TSAB ? Comedy ? DVD Movies Catalog ? Top"?

 

I know it looks funny but this is what i need.

Posted

you could edit the breadcrumb class and reverse the array process (($this->_trail in function trail() )

Posted

thanks for your reply. after studying osc awhile, all i need to tell my browser to encode to "Arabic-1256" and from "right to left".

 

How do I do that?

Posted

far better to modify the existing function for what you need:

 

    function trail($separator = ' - ') {
     $trail_string = '';
     $tmp_array = array();
     $tmp_array = array_reverse($this->_trail);

     for ($i=0, $n=sizeof($tmp_array); $i<$n; $i++) {
       if (isset($tmp_array[$i]['link']) && tep_not_null($tmp_array[$i]['link'])) {
         $trail_string .= '<a href="' . $tmp_array[$i]['link'] . '" class="headerNavigation">' . $tmp_array[$i]['title'] . '</a>';
       } else {
         $trail_string .= $tmp_array[$i]['title'];
       }

       if (($i+1) < $n) $trail_string .= $separator;
     }
     return $trail_string;
   }

 

replace the trail function with it in includes\classes\breadcrumb.php

 

or you could explode()/implode() in the header.php and in/between your do the array reverse. Many ways to do it.

Archived

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

×
×
  • Create New...