简体   繁体   中英

Joomla breadcrumbs with Virtuemart Cart

When i click the shopping cart link. The breadcrumbs displays doble link titles like the one attached: 面包屑

and here is my code:

    <?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<div class="breadcrumb">
<span class="left"></span>
<ul>
<?php for ($i = 0; $i < $count; $i ++) :

// If not the last item in the breadcrumbs add the separator
if ($i < $count -1){
if(!empty($list[$i]->link)) {
echo '<li><a href="'.$list[$i]->link.'" class="pathway">'.$list[$i]->name.'</a></li>';
} else {
echo '<li>'.$list[$i]->name.'</li>';
}
//echo ' '.$separator.' ';
}else if ($params->get('showLast', 1)) 
{ // when $i == $count -1 and 'showLast' is true
    echo '<li>'.$list[$i]->name.'</li>';
}
endfor; ?>
</ul>
<span class="right"></span>
</div>

how can i eliminate the first uRL?

Try something like this

if($i!=0){

    if($list[$i - 1]->name != $list[$i]->name){
    echo '<li>'.$list[$i]->name.'</li>';
    echo $separator;
    }
}

Another way this only happen in this page then you can remove the first li using jQuery

find the nth child option and remove It.

Hope this may help you..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM