layout

Magento2 - Conditional layout directives

June 14, 2020

Introduction # I consider Magento’s template engine, based on XMLs, .phtmls - as the best one on the world. Sure, entrance barrier is high, especially for frontend developers, but as soon as one learns how to use it properly - whole new world is open. With XMLs approach - templating engine is highly customizable and flexible. Layouts can be extended and altered by 3rd party code. Sometimes - we need to include block (or exclude), based on some conditions. ...