【问题标题】:How can i detect category page on Joomla?我如何检测 Joomla 上的类别页面?
【发布时间】:2014-07-03 12:01:20
【问题描述】:

我想检测 mod_breadcrumbs 中的 mercurialmart 类别页面。

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

我的面包屑代码:

 <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>

【问题讨论】:

    标签: php joomla joomla2.5 virtuemart


    【解决方案1】:

    您可以通过以下方式检查您是否在类别视图中:

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

    【讨论】:

      猜你喜欢
      • 2014-03-18
      • 2018-01-18
      • 2012-03-08
      • 2014-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-05
      相关资源
      最近更新 更多