I need to add my *.phtml page to right part of the site in special category and subcategories.

I tried <catalog_category_view>, but it is for all categories. I also tried <CATEGORY_{category_id}> but it is not working (do not know why) and i think it will not be for subcategories.

So, how may i do it? where should i paste this code:

 <reference name="right">
            <block type="my_module/block" name="blog.articles"
  • <reference name="right"> <block type="tsg_widgetblog/widgetblog" name="blog.articles" as="blog.articles" template="widgetblog/portalcatalog/articles.phtml" translate="label"> <label>Articles</label> </block> </reference> – Roma Kis Jan 19 '16 at 9:17
  • Try with custom layout update part in those categories. – Prateek Jan 19 '16 at 9:30

RESOLVED: I created my own handle. I wrote an observer for controller_action_layout_load_before and added my handle after the following condition:

if (strpos(Mage::registry('current_category')->getPath(), '{category_id}')) 
| improve this answer | |
  • Thanks for sharing your solution. It would be great if you also added the code that adds the layout handle. Keep in mind that you can accept your own answer after 2 days. – Fabian Schmengler Jan 20 '16 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.