2013-07-31 81 views
0

我试图在第一页上仅显示类别描述。下面的代码不工作 - 任何想法如何解决它?如何仅在Magento的第一页上显示类别描述

<div class="category-description std"> 
    <?php 
    if (strlen($_SERVER['QUERY_STRING']) = 0 || $_GET['p'] = '1') 
     { 

     echo $_helper->categoryAttribute($_category, $_description, 'description'); 

     } 

    ?> 
</div> 

回答

1

请试试这个:

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?> 
<?php $currentPage = (int) Mage::App()->getRequest()->getParam('p'); 
if($currentPage <= 1): 
?> 
<div class="category-description std"> 
    <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?> 
</div> 
<?php endif; ?> 
<?php endif; ?>' 
0

您可以使用产品列表工具栏要知道,如果你在第一页上:

if ($this->isContentMode() 
    || $this->getChild('product_list')->getToolbarBlock()->isFirstPage()) { 
    // Display description (assuming that content mode is always first page) 
} 
相关问题