I'm aware that I can change the layout of a specific category by creating a layout file with the name catalog_category_view_id_123.xml where 123 is my category id.

How do I apply a layout change to the parent category (e.g. "Car Parts" with the id "123") and all sub-categories (and sub-sub and sub-sub-sub etc)?

What I'm attempting to do is load one block on a bulk of categories, and a different block on a bulk of different categories.

1 Answer 1


You can work in products.phtml file in


Simply put condition if category has subcategories based on your requirement.

You can change whole layout but you can set structure as per your need

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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