0

I'm using Magento 1.9 and struggling on one thing. I have a CMS block in my category page but I want it to show only on the first page! So if I scroll down and move to page 2 on the same category I don't want to see that CMS block again. I tried to put this code in the CMS block... but it ignores me (category-accordion.accordion is the main div of the CMS block)

I changed the catalog/category/view.phtml as follows but it seems that Magento checks the condition only in the first page because it keeps the block on all the other pages...

I'm using Magento 1.9 and struggling on one thing. I have a CMS block in my category page but I want it to show only on the first page! So if I scroll down and move to page 2 on the same category I don't want to see that CMS block again. I tried to put this code in the CMS block... but it ignores me (category-accordion.accordion is the main div of the CMS block)

I changed the catalog/category/view.phtml as follows but it seems that Magento checks the condition only in the first page because it keeps the block on all the other pages...

if($this->isContentMode()) {
echo $this->getCmsBlockHtml();
}
else if($this->isMixedMode() && strpos($_SERVER['REQUEST_URI'], '?=p') == false) {
echo $this->getCmsBlockHtml();
echo $this->getProductListHtml();
}
else {
echo $this->getProductListHtml();
}

1 Answer 1

0

instead of use $_SERVER['REQUEST_URI'].

You should try with

 (int)  Mage::app()->getRequest()->getParam('p')==1
1
  • Same result... What the condition exactly means? because I want the block to show only in first page and not other pages.
    – Elettra D
    May 28, 2016 at 12:14

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.