1

How can we remove the category descriptions for "additional pages".. like

http://www.uretilalt.dk/herreure?p=10

For instance?

Manage to remove from filtered results, but can't figures this part out?

Magento ver. 1.9.2.4

1 Answer 1

2

To avoid displaying category descriptions, there are two possibilities

Via the backend

You'll need to edit every single category and remove the description manually.

Via the templates

Edit app/design/frontend/<your_package>/<your_theme>/template/catalog/category/view.phtml and replace the following code:

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
    <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?>

With:

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
    <?php $page = Mage::app()->getRequest()->getParam('p'); ?>
    <?php if (!$page): ?>
        <div class="category-description std">
            <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
        </div>
    <?php endif; ?>
<?php endif; ?>
7
  • thanks for commenting.. that code removes all categories, we want to have it on the "base" uretilalt.dk/herreure but not on all additional pages like uretilalt.dk/herreure?p=1 + 2 + 3 etc.. Jun 8, 2016 at 19:27
  • @JonasLyngholm ok I understand now see my updated answer Jun 8, 2016 at 19:38
  • I think there's an error somewhere? Tried with and without the "double <?php endif; ?> <?php endif; ?>" - but end up with a almost blank page (just top header left?) Jun 8, 2016 at 20:35
  • @JonasLyngholm I'll check that out tomorrow and let you know but that's definitely the logic you need to follow Jun 8, 2016 at 20:37
  • @JonasLyngholm just made the test on my own website and it works perfectly with the code I pasted. Ensure you did the replace the right bit of original code and did not miss or remove anything else Jun 9, 2016 at 8:54

Your Answer

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

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