0

What is the best way to only show the category description on the first page of a category?

I found the following way but not sure if it is the best:

 <?php $currentPage = (int) Mage::App()->getRequest()->getParam('p'); 
    if($currentPage <= 1): ?>
        <div class="category-description std">              <div class="category-description std">
            <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>                 <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
        </div>              </div>
    <?php endif; ?>
4
  • 1
    Have you tried it? If it works is the best.
    – Marius
    Jul 17, 2015 at 13:05
  • In which file,have you done the changes?
    – Amit Bera
    Jul 17, 2015 at 13:26
  • itmay be spelling mistake Mage::App()->getRequest()->getParam('p') to Mage::app()->getRequest()->getParam('p')
    – Amit Bera
    Jul 17, 2015 at 13:30
  • The code above works. I'm just not sure if it is the most optimal way to go about doing it. Jul 20, 2015 at 15:53

1 Answer 1

0

I am trying to do this in Magento 2 (2.4.3) and also removing the description from all of the filtered pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.