Alex Rivera | Logout

How to check CMS block is active?

Asked 2010-02-17T16:34:35.543
10

I wonder how to check that a particular CMS block is active or not.

So far I have found that CMS block are Mage_Cms_Block_Block class that inherits from Mage_Cms_Block_Abstract class

Mage::log(get_class(Mage::app()->getLayout()->createBlock('cms/block')->setBlockId('promo_space')

Neither of the two classes have methods that would check wether the block is active or not. How do I do it?

Edit
Report

1 Answer

18

Mage::getModel('cms/block')->load('static_block_identifier')->getIsActive()

Replace static_block_identifier with the identifier you assigned to your CMS static block.

answered 2012-05-01T22:31:57.717

Your Answer