As a frontend developer at a digital agency that is no stranger to eCommerce, Magento’s local.xml is a best friend. Let’s face it, knowing your layout XML files is at the heart of knowing frontend Magento development and the more layout handles you know, the better — so I’d like share some with you. Want to target some specific categories, category types, products, etc. in layout files? Add a CMS block to only one product? Let’s keep our code clean by keeping it in local.xml. Here we go —
Product Types (Commonly Known):
So if your category id is 25, your node would be:
So if your product id is 134, you’d write:
… then perform whatever actions you’d like within the handles. Clean code that’s easy to read — just don’t forget to include comments!