如何检测Joomla上的分类页面?



我想在mod_breadcrumb中检测virtuemart类别页面。

面包屑正在加载所有页面,我只是想在类别页面中写一个消息。

我的面包屑代码:

 <div class="breadcrumbs<?php echo $moduleclass_sfx; ?>">
    <?php 
        echo '<ul>';
        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 class="pathway">' . $list[$i]->name . '</li>';
                if($i < $count -2) echo ' <li class="pathway separator">></li> ';
            } else if ($params->get('showLast', 1)) { // when $i == $count -1 and 'showLast' is true
                if($i > 0) echo ' <li class="pathway separator">></li> ';
                echo '<li class="pathway">' . $list[$i]->name . '</li>';
            }
        } 
        echo '</ul>';
    ?>
    </div>

检查是否在类别视图中:

$appInput = Jfactory::getApplication()->input;
if($appInput->getCmd('option')=='com_content' && $appInput->getCmd('view')=='category' ){
//add your code here
}

最新更新