I have to modify mega menu extension in Magento 1.9. Currently, its showing static block at bottom of category.

image_bottom I want to separate static block identifier name based on some symbol like _ in my custom block code function.

In one of the block folder file below code is written.

const CUSTOM_BLOCK_TEMPLATE = "wp_custom_menu_%d";
 $blockId = sprintf(self::CUSTOM_BLOCK_TEMPLATE, $id); 
 $collection = Mage::getModel('cms/block')->getCollection()
            ->addFieldToFilter('identifier', array(array('like' => $blockId . '_w%'), array('eq' => $blockId)))
            ->addFieldToFilter('is_active', 1);
        $blockId = $collection->getFirstItem()->getIdentifier();

Static block identifier is suggested to be named as wp_custom_menu_HereCatID

What i want is to achieve the name of static block identifer as something like this wp_custom_menu_HereCatId_Right for Right and wp_custom_menu_HereCatId_Bottom for Bottom position

I can use explode, but i want to learn in Magento way as done above.

1 Answer 1


You can add custom field to the category where admin can choose bottom or side here you find how to do it . after that you enter to the megamenu plugin and customize the code : if field value = side you add a css class .sideblock to the static block else you add the class .bottomblock all the rest is to create the css of the 2 classes

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.