Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Manipulating static blocks
 
jmayer
Jr. Member
 
Total Posts:  21
Joined:  2007-09-03
 

Here’s what I am trying to do. I would like to have a conditional block that will be used for an anchor category. This block from the CMS appears on top of the products.  Is there a way to show a different block or manipulate the current CMS block to show different content on the 2nd page of the category pages. In my situation this initial CMS block is too large to display on every page in this section.

I am trying to avoid showing the same CMS block on consecutive pages, page 2, 3, etc.

Any ideas would be appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gabrielk
Sr. Member
 
Avatar
Total Posts:  83
Joined:  2007-11-30
 

You would do something like:

<?php if($condition==true{ $this->getLayout()->createBlock('cms/block')->setBlockId($blockID)->toHtml(); } ?>

Where condition is some pre-defined variable (page id, etc) or even as simple as a strpos on the url.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top