Got it myself
I created the isActive (Identifiere, Value) method in the auxiliary block "Block" in the local Mage / Cms module.
This is how the method looks
public function isActive($attribute, $value){ $col = Mage::getModel('cms/block')->getCollection(); $col->addFieldToFilter($attribute, $value); $item = $col->getFirstItem(); $id = $item->getData('is_active'); if($id == 1){ return true; }else{ return false; } }
the $ attribute parameter is a table field (cms-block), such as "identifier" or "title", and the value can be the name of the static block itself or the identifier itself. Both are used to filter the specific static block that interests you.
This is how I call the assistant
if(Mage::helper('cms/block')->isActive('identifier','promo_space')){
I also updated the config.xml file for the Cms block to read my new helper and method.
I hope this will be helpful.
latvian
source share