{"id":16173,"date":"2018-09-06T12:47:04","date_gmt":"2018-09-06T10:47:04","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=16173"},"modified":"2025-05-21T18:56:42","modified_gmt":"2025-05-21T16:56:42","slug":"module-layout-handles-in-magento-2","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html","title":{"rendered":"Magento Layout: Module Layout Handles in Magento 2"},"content":{"rendered":"\n<p data-pm-slice=\"1 1 []\">When writing modules, there might be a need to make edits to some pages using module area files. This can be adding, modifying, or editing any elements on the page. Changes are made to the Layout handles XML files.<\/p>\n<p><!--more--><br>\n<a href=\"#par_1\">The name of the layout<\/a><br>\n<a href=\"#par_2\">Layout customization tasks<\/a><br>\n<a href=\"#par_3\">Where layout handles are stored<\/a><br>\n<a href=\"#par_4\">Extend &amp; override layouts<\/a><br>\n<a href=\"#par_5\">Extend module layout<\/a><br>\n<a href=\"#par_6\">Override module layout<\/a><br>\n<a href=\"#par_7\">Override theme layout<\/a><br>\n<a href=\"#par_8\">View the result of an xml layout on a page<\/a><\/p>\n<h2>Introduction to Layouts<\/h2>\n<p>Layouts are a crucial component of Magento 2, enabling merchants to create unique and personalized online stores. A layout is an XML file that defines the structure and content of various web pages. Each page in Magento 2 has an associated layout file that specifies the blocks, containers, and other elements that constitute the page. Grasping layouts is vital for developing a customized and user-friendly online store.<\/p>\n<p>Magento offers a variety of layout options, including default layouts for both the frontend and backend, as well as the capability to create custom layouts using layout files. By mastering layouts, you can ensure that your Magento 2 store stands out and delivers an excellent user experience.<\/p>\n<h3>Understanding Layout Files<\/h3>\n<p>There are several types of layout files, including page layout files, page configuration files, and generic layout files. Page layout files define the structure of a page, while page configuration files define the content of a page. Generic layout files are used for pages returned in AJAX requests, emails, and HTML code snippets. To create a custom layout file, you need to create a new layout XML file with a unique name, such as &ldquo;new_layout_index.xml&rdquo;, and define the structure of the web page.<\/p>\n<h2><a id=\"par_1\"><\/a><strong><span style=\"color: #000000;\">The name of the layout xml<\/span><\/strong><strong><span style=\"color: #000000;\">&nbsp;file<\/span><\/strong><\/h2>\n<p data-pm-slice=\"1 1 []\">The XML file is named based on the routing. Page type layout handles are unique identifiers linked to specific page-type actions within a framework. For example, product URL look like this: \/catalog\/product\/view\/&hellip; Therefore, the layout for this page will be <em>catalog_product_view.xml.<\/em> If the changes should be made on all pages, the file will be named <em>default.xml.<\/em><\/p>\n<h2><a id=\"par_2\"><\/a><strong><span style=\"color: #000000;\">Layout customization tasks<\/span><\/strong><\/h2>\n<p>Let&rsquo;s take a quick look at how you can customize layouts.<\/p>\n<p><strong><span style=\"color: #000000;\">Set the page layout<\/span><\/strong><\/p>\n<p>Page layout is specified in the root <em>&lt;page&gt;<\/em> node.<\/p>\n<p>Default theme has the following page layouts:<\/p>\n<ul>\n<li>1column<\/li>\n<li>2columns-left<\/li>\n<li>2columns-right<\/li>\n<li>3columns<\/li>\n<\/ul>\n<p>which are located at: <em>\/vendor\/magento\/module-theme\/view\/frontend\/page_layout.<\/em><\/p>\n<p data-pm-slice=\"1 1 []\">A two-column page layout can be specified in the XML document, which outlines the arrangement and presentation of content to users on a website.<\/p>\n<p>Let&rsquo;s take a look at&nbsp;the example of assigning the <em>1column<\/em> layout for a product page:<br>\n<em>module-catalog\/view\/frontend\/layout\/catalog_product_view.xml<\/em><\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;page layout=\"1column\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\r\n&hellip;\r\n&lt;\/page&gt;<\/pre>\n<p data-pm-slice=\"1 1 []\">Theme layout files are typically located in the \/vendor\/magento\/module-theme\/view\/frontend\/page_layout directory.<\/p>\n<h4><strong><span style=\"color: #000000;\">Include or remove static resources (JavaScript, CSS, fonts) in &lt;head&gt;<\/span><\/strong><\/h4>\n<p>JavaScript, CSS and other static assets are added in the &lt;head&gt; node. Let&rsquo;s look at the example of using&nbsp;it in the layout:<br>\nmodule-theme\/view\/frontend\/layout\/default_head_blocks.xml<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\r\n&nbsp;&nbsp;&nbsp;&lt;head&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\/&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;css src=\"mage\/calendar.css\"\/&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script src=\"requirejs\/require.js\"\/&gt;\r\n&nbsp;&nbsp;&nbsp;&lt;\/head&gt;\r\n&nbsp;&nbsp;&nbsp;...\r\n&lt;\/page&gt;<\/pre>\n<p>When adding external resources, you must specify an attribute <em>src_type=&rdquo;url<\/em><em>&ldquo;<\/em>.<\/p>\n<p>To add Google fonts, you need to add the attributes <em>rel=<\/em>&ldquo;<em>stylesheet<\/em><em>&ldquo;<\/em> and <em>type=<\/em>&ldquo;<em>text\/css<\/em>&ldquo;.<\/p>\n<p>To add JavaScript, you can use &nbsp;<em>&lt;link src=&rdquo;js\/sample.js&rdquo;\/&gt;<\/em> or <em>&lt;script src=&rdquo;js\/sample.js&rdquo;\/&gt;<\/em> instructions.<\/p>\n<p>The example of using the external resource:<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\r\n&lt;head&gt;\r\n&hellip;\r\n&lt;css src=\"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.4\/css\/bootstrap-theme.min.css\" src_type=\"url\" \/&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script src=\"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.4\/js\/bootstrap.min.js\" src_type=\"url\" \/&gt;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;link rel=\"stylesheet\" type=\"text\/css\" src=\"http:\/\/fonts.googleapis.com\/css?family=Montserrat\" src_type=\"url\" \/&gt; \r\n&lt;\/head&gt;\r\n&lt;\/page&gt;<\/pre>\n<h4><strong><span style=\"color: #000000;\">Adding conditional comments<\/span><\/strong><\/h4>\n<p>Conditional comments are meant for special instructions for Internet Explorer.<\/p>\n<p data-pm-slice=\"1 1 []\">In layout files, they are used as follows:<\/p>\n<pre class=\"lang:php decode:true\">&lt;head&gt;\r\n&lt;css src=\"css\/ie-9.css\" ie_condition=\"IE 9\" \/&gt;\r\n&lt;\/head<\/pre>\n<p>You can take a look at its usage in *.phtml file at:&nbsp;<em>magento2-base\/setup\/view\/layout\/layout.phtml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\n...\r\n&lt;!--[if IE 9]&gt;\r\n&lt;html class=\"ie9\" lang=\"en\" ng-app=\"magentoSetup\"&gt;&lt;![endif]--&gt;\r\n&lt;!--[if !IE]&gt;&lt;!--&gt;\r\n&lt;html lang=\"en\" ng-app=\"magentoSetup\"&gt;\r\n&lt;!--&lt;![endif]--&gt;\r\n...<\/pre>\n<h4><strong><span style=\"color: #000000;\">Create a container or block<\/span><\/strong><\/h4>\n<p data-pm-slice=\"1 1 []\">A typical block consists of a class and a PHTML file that contains HTML and data from the class&rsquo;s methods. The parent element provides an alias name for blocks and determines how child elements are rendered within the overall structure. The container does not have classes or PHTML. Containers can hold one or more child blocks, which may include other containers or simple content blocks. The container is similar to HTML markup, to which you can attach blocks using the &ldquo;as&rdquo; attribute. Also, the container has <em>htmlTag<\/em> and <em>htmlClass<\/em>&nbsp;attributes.<\/p>\n<p>Let&rsquo;s look at the example of creating a container and a block in the layout:<br>\n<em>module-theme\/view\/frontend\/layout\/default.xml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;block name=\"require.js\" class=\"Magento\\Framework\\View\\Element\\Template\" template=\"Magento_Theme::page\/js\/require_js.phtml\" \/&gt;\r\n&lt;container name=\"page.bottom\" label=\"Before Page Footer\" htmlTag=\"div\" htmlClass=\"content\"\/&gt;<\/pre>\n<h4><span style=\"color: #000000;\"><strong>Reference a container or a block<\/strong><\/span><\/h4>\n<p>To update a block or container,&nbsp;<em>referenceBlock<\/em>&nbsp;and&nbsp;<em>referenceContainer<\/em>&nbsp;instructions are used. Header links are a key example of blocks used in Magento layouts.<\/p>\n<p>Let&rsquo;s look at the <em>reference<\/em> container and the block in the layout:<br>\n<em>module-theme\/view\/frontend\/layout\/default.xml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;referenceBlock name=\"top.links\"&gt;\r\n&lt;block class=\"Magento\\Theme\\Block\\Html\\Header\" name=\"header\" as=\"header\" before=\"-\"&gt;\r\n&lt;arguments&gt;\r\n&lt;argument name=\"show_part\" xsi:type=\"string\"&gt;welcome&lt;\/argument&gt;\r\n&lt;\/arguments&gt;\r\n&lt;\/block&gt;\r\n&lt;\/referenceBlock&gt;\r\n&lt;referenceContainer name=\"main.content\"&gt;\r\n&lt;block class=\"Magento\\Framework\\View\\Element\\Template\" name=\"skip_to_content.target\" before=\"-\" template=\"Magento_Theme::html\/skiptarget.phtml\"&gt;\r\n&lt;arguments&gt;\r\n&lt;argument name=\"target_id\" xsi:type=\"string\"&gt;contentarea&lt;\/argument&gt;\r\n&lt;\/arguments&gt;\r\n&lt;\/block&gt;\r\n&lt;\/referenceContainer&gt;<\/pre>\n<h4><strong><span style=\"color: #000000;\">Set the template used by a block<\/span><\/strong><\/h4>\n<p>There are 2 ways to assign a block to a template:<\/p>\n<ul>\n<li>Using template attribute<\/li>\n<\/ul>\n<p>&lt;referenceBlock name=&rdquo;customer_form_register&rdquo; template=&rdquo;Magento_Checkout::cart\/item\/configure\/updatecart.phtml&rdquo;\/&gt;<\/p>\n<ul>\n<li>Using &lt;argument&gt; instruction<\/li>\n<\/ul>\n<pre class=\"lang:php decode:true\">&lt;referenceBlock name=\"product.info.addtocart\"&gt;\r\n&lt;action method=\"setTemplate\"&gt;\r\n&lt;argument name=\"template\" xsi:type=\"string\"&gt;Magento_Checkout::cart\/item\/configure\/updatecart.phtml&lt;\/argument&gt;\r\n&lt;\/action&gt;\r\n&lt;\/referenceBlock&gt;<\/pre>\n<p data-pm-slice=\"1 1 []\">Templates defined as attributes have a higher priority than those specified as arguments.<\/p>\n<h4><strong><span style=\"color: #000000;\">Modify block arguments<\/span><\/strong><\/h4>\n<p>To modify block arguments, use the <em>&lt;referenceBlock&gt;<\/em> instruction.<\/p>\n<p data-pm-slice=\"1 1 []\">Ensuring that the actual rendering of block output aligns with the intended design is crucial.<\/p>\n<p>Let&rsquo;s look at the layout:<br>\nmodule-wishlist\/view\/frontend\/layout\/customer_account.xml<\/p>\n<p>It has a block:<\/p>\n<pre class=\"lang:php decode:true\">&lt;block class=\"Magento\\Framework\\View\\Element\\Html\\Link\\Current\" ifconfig=\"wishlist\/general\/active\" name=\"customer-account-navigation-wish-list-link\"&gt;\r\n&lt;arguments&gt;\r\n&lt;argument name=\"path\" xsi:type=\"string\"&gt;wishlist&lt;\/argument&gt;\r\n&lt;argument name=\"label\" xsi:type=\"string\"&gt;My Wish List&lt;\/argument&gt;\r\n&lt;\/arguments&gt;\r\n&lt;\/block&gt;<\/pre>\n<p>Extending layout will be:<\/p>\n<pre class=\"lang:php decode:true\">&lt;referenceBlock name=\"customer-account-navigation-wish-list-link\"&gt;\r\n&lt;arguments&gt;\r\n&lt;!-- Modified block argument --&gt;\r\n&lt;argument name=\"label\" xsi:type=\"string\"&gt;Wish List&lt;\/argument&gt;\r\n&lt;!-- Newly added block argument --&gt;\r\n&lt;argument name=\"custom_label\" xsi:type=\"string\"&gt;Custom Block Label&lt;\/argument&gt;\r\n&lt;\/arguments&gt;\r\n&lt;\/referenceBlock&gt;<\/pre>\n<h4><strong><span style=\"color: #000000;\">Use block object methods to set block properties<\/span><\/strong><\/h4>\n<p>There are 2 ways to do this:<\/p>\n<ul>\n<li>using the <em><a href=\"https:\/\/devdocs.magento.com\/guides\/v2.0\/frontend-dev-guide\/layouts\/xml-instructions.html#argument\" target=\"_blank\" rel=\"noopener\">&lt;argument&gt;<\/a><\/em> instruction for <em>&lt;block&gt;<\/em> or <em>&lt;referenceBlock&gt;.<\/em><\/li>\n<\/ul>\n<p>Let&rsquo;s look at the example of&nbsp;using it in the layout:<br>\n<em>module-catalog\/view\/frontend\/layout\/catalog_product_view.xml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;referenceBlock name=\"page.main.title\"&gt;\r\n&lt;arguments&gt;\r\n&lt;argument name=\"css_class\" xsi:type=\"string\"&gt;product&lt;\/argument&gt;\r\n&lt;argument name=\"add_base_attribute\" xsi:type=\"string\"&gt;itemprop=\"name\"&lt;\/argument&gt;\r\n&lt;\/arguments&gt;\r\n&lt;\/referenceBlock&gt;<\/pre>\n<p>CSS class is set and an attribute is added for the product page.<\/p>\n<p>using the <a href=\"https:\/\/devdocs.magento.com\/guides\/v2.0\/frontend-dev-guide\/layouts\/xml-instructions.html#fedg_layout_xml-instruc_ex_act\" target=\"_blank\" rel=\"noopener\">&lt;action&gt;<\/a> instruction. Use this method only when you can not use the previous one.<\/p>\n<p>Let&rsquo;s look at an example of using it in the layout:<br>\n<em>module-customer\/view\/frontend\/layout\/customer_account_index.xml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;referenceBlock name=\"page.main.title\"&gt;\r\n&lt;action method=\"setPageTitle\"&gt;\r\n&lt;argument translate=\"true\" name=\"title\" xsi:type=\"string\"&gt;My Dashboard&lt;\/argument&gt;\r\n&lt;\/action&gt;\r\n&lt;\/referenceBlock&gt;<\/pre>\n<h4><strong><span style=\"color: #000000;\">Rearrange elements<\/span><\/strong><\/h4>\n<p data-pm-slice=\"1 1 []\">The arrangement of elements within the XML document defines page structure.<\/p>\n<p>There are 2 ways to change the order of elements on a page:<\/p>\n<ul>\n<li>Using the &lt;move&gt; construction;<\/li>\n<li>Specifying <em>before<\/em> and <em>after<\/em> attributes.<\/li>\n<\/ul>\n<p>Let&rsquo;s take a look at using the &lt;move&gt; instruction in the layout:<br>\n<em>module-theme\/view\/frontend\/layout\/print.xml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;page layout=\"1column\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\r\n&lt;body&gt;\r\n...\r\n&lt;move element=\"logo\" destination=\"main.content\" before=\"-\" \/&gt;\r\n&lt;move element=\"copyright\" destination=\"main.content\" after=\"-\" \/&gt;\r\n...\r\n&lt;\/body&gt;\r\n&lt;\/page&gt;<\/pre>\n<p>In the value of the <em>before \/ after<\/em> attribute, we can specify the name of the element, before or after which we need to insert a block, indicating whether the block should be the first or last. If the block should be the first or the last, as in the example, the value &ldquo;-&rdquo; is used.<\/p>\n<p>Let&rsquo;s take a look at using <em>before<\/em> and <em>after<\/em> attributes:<br>\n<em>module-sales\/view\/frontend\/layout\/sales_order_view.xml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\r\n....\r\n&lt;referenceContainer name=\"content\"&gt;\r\n&lt;block class=\"Magento\\Sales\\Block\\Order\\View\" name=\"order.comments\" template=\"order\/order_comments.phtml\" before=\"sales.order.info.links\"\/&gt;\r\n&lt;block class=\"Magento\\Sales\\Block\\Order\\View\" name=\"sales.order.view\" cacheable=\"false\" after=\"sales.order.info.links\"&gt;\r\n...\r\n&lt;\/referenceContainer&gt;\r\n...\r\n&lt;\/body&gt;\r\n&lt;\/page&gt;<\/pre>\n<h4><strong><span style=\"color: #000000;\">Remove elements<\/span><\/strong><\/h4>\n<p>The <em>remove<\/em> attribute is used for removing elements in &lt;referenceBlock&gt; and &lt;referenceContainer&gt;.<\/p>\n<p>Let&rsquo;s look at the example in the layout:<br>\n<em>module-theme\/view\/frontend\/layout\/print.xml<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;page layout=\"1column\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\r\n&lt;body&gt;\r\n&lt;referenceContainer name=\"header.container\" remove=\"true\"\/&gt;\r\n&lt;referenceBlock name=\"catalog.topnav\" remove=\"true\"\/&gt;\r\n&lt;referenceContainer name=\"footer-container\" remove=\"true\"\/&gt;\r\n...\r\n&lt;\/body&gt;\r\n&lt;\/page&gt;<\/pre>\n<h4><strong><span style=\"color: #000000;\">Replace elements<\/span><\/strong><\/h4>\n<p>There is no mechanism to replace an element, but you can delete it and add a new one.<\/p>\n<h2><a id=\"par_3\"><\/a><strong><span style=\"color: #000000;\">Where layout handles are stored<\/span><\/strong><\/h2>\n<p>app\/code\/&lt;Vendor&gt;\/&lt;Module&gt;\/view\/frontend\/layout\/ &ndash; front end;<\/p>\n<p>app\/code\/&lt;Vendor&gt;\/&lt;Module&gt;\/view\/adminhtml\/layout\/ &ndash; back end.<\/p>\n<p data-pm-slice=\"1 1 []\">Files placed in the designated \/layout\/ folder are used to modify the appearance and structure of product pages.<\/p>\n<h2><a id=\"par_4\"><\/a><strong><span style=\"color: #000000;\">Extend &amp; override layouts<\/span><\/strong><\/h2>\n<p data-pm-slice=\"1 1 []\">To change layouts, you can use <em>extend &amp; override<\/em>. Basic page Configuration layouts define and expand the basic view of storefront pages within the Magento_Theme module.<\/p>\n<p><em>Extend<\/em> means that you do not need to copy the entire file; instead, you only need to specify the changes from the parent layout. Using <em>override<\/em>, you can copy the layout and work with it; in this case, the data from the parent layout will not be considered. I would like to point out that the layout override is not recommended.<\/p>\n<h2><a id=\"par_5\"><\/a><strong><span style=\"color: #000000;\">Extend module layout<\/span><\/strong><\/h2>\n<p>The path to the files:<br>\n<em>app\/design\/[StoreSide]\/[Vendor]\/[theme]\/[Vendor_Module]\/layout\/<\/em><\/p>\n<p>For example, if you need module&rsquo;s extend layout:<em><br>\napp\/code\/Belvg\/Example\/view\/frontend\/layout\/layout.xml<\/em><\/p>\n<p>The path to it will be:<br>\n<em>app\/design\/frontend\/Vendor\/theme\/Belvg_Example\/layout\/layout.xml<\/em><\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/store.belvg.com\/layered-navigation.html\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/09\/magento_ico_1.9_layered_navigation.jpg\" width=\"450\" height=\"450\" alt=\"magento_ico_1.9_layered_navigation\" class=\"module_image\" title=\"Magento Layout: Module Layout Handles in Magento 2\"><div class=\"module_content_part\"><h3 class=\"title\">Layered Navigation<\/h3><p class=\"module_content_text\">Take your online store to the new level together with BelVG's extensions<\/p><a href=\"https:\/\/store.belvg.com\/layered-navigation.html\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Download here<\/span><\/a><\/div><\/div><\/div>\n<h2><a id=\"par_6\"><\/a><strong><span style=\"color: #000000;\">Override module layout<\/span><\/strong><\/h2>\n<p>The path to the files:<br>\n<em>app\/design\/[StoreSide]\/[Vendor]\/[theme]\/[Vendor_Module]\/layout\/override\/base\/<\/em><\/p>\n<p>For example, if you need to override module&rsquo;s layout:<br>\n<em>app\/code\/Belvg\/Example\/view\/frontend\/layout\/layout.xml<\/em><\/p>\n<p>The path to it will be:<br>\n<em>app\/design\/frontend\/Vendor\/theme\/Belvg_Example\/layout\/override\/base\/layout.xml<\/em><\/p>\n<p data-pm-slice=\"1 1 []\">Note: The base folder is intended for overriding module layouts. If we wanted to overload the theme layout, the folder would be called theme, and the path to it would be:<em>app\/design\/[StoreSide]\/[Vendor]\/[theme]\/[Vendor_Module]\/layout\/override\/theme\/[Vendor2]\/[theme2]\/<\/em><\/p>\n<h2><a id=\"par_7\"><\/a><strong><span style=\"color: #000000;\">Override theme layout<\/span><\/strong><\/h2>\n<p>For example, if you need to override theme layout:<br>\n<em>app\/design\/frontend\/Magento\/Luma\/Magento_Theme\/layout\/default.xml<\/em><\/p>\n<p>The path to it will be:<br>\n<em>app\/design\/frontend\/[Vendor]\/[theme]\/Magento_Theme\/layout\/override\/theme\/Magento\/blank\/default.xml<\/em><\/p>\n<h2><a id=\"par_8\"><\/a><strong><span style=\"color: #000000;\">View the result of an XML layout on a page<\/span><\/strong><\/h2>\n<p data-pm-slice=\"1 1 []\">When we visit a page, the XML layout is built for it. The XML layout for a specific page, such as the homepage or product pages, can be customized using unique layout handles associated with those pages. Let&rsquo;s look at the result using the Observer.<\/p>\n<p>1.&nbsp;Create <strong>module.xml<\/strong>:<br>\n<em>app\/code\/Belvg\/LayoutLogger\/etc\/module.xml<\/em><\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;?xml version=\"1.0\" ?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module\/etc\/module.xsd\"&gt;\r\n&lt;module name=\"Belvg_LayoutLogger\" setup_version=\"1.0.0\"\/&gt;\r\n&lt;\/config&gt;<\/pre>\n<p>2.&nbsp;Create <strong>registeration.php<\/strong>:<br>\n<em>app\/code\/Belvg\/LayoutLogger\/registration.php<\/em><\/p>\n<pre class=\"lang:php decode:true \">&lt;?php\r\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\r\n\\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\r\n'Belvg_LayoutLogger',\r\nDIR\r\n);<\/pre>\n<p>3. Create <strong>events.xml<\/strong> and declare the observer:<br>\n<em>app\/code\/Belvg\/LayoutLogger\/etc\/frontend\/events.xml<\/em><\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Event\/etc\/events.xsd\"&gt;\r\n&lt;event name=\"layout_generate_blocks_after\"&gt;\r\n&lt;observer name=\"belvg_layout_logger_layout_generate_blocks_after\" instance=\"Belvg\\LayoutLogger\\Model\\Layout\" \/&gt;\r\n&lt;\/event&gt;\r\n&lt;\/config&gt;<\/pre>\n<p>4. Create an observer that will write all layout pages into a separate xml file:<br>\n<em>app\/code\/Belvg\/LayoutLogger\/Module\/Layout.php<\/em><\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\nnamespace Belvg\\LayoutLogger\\Model;\r\n\r\nuse Magento\\Framework\\App\\RequestInterface;\r\nuse Magento\\Framework\\Event\\Observer;\r\nuse Magento\\Framework\\Event\\ObserverInterface;\r\n\r\nclass Layout implements ObserverInterface\r\n{\r\n    protected $request;\r\n    public function __construct(\r\n        RequestInterface $request\r\n    ) {\r\n        $this-&gt;request = $request;\r\n    }\r\n    public function execute(Observer $observer)\r\n    {\r\n        $layoutsDir = BP . '\/var\/log\/layouts\/';\r\n        if (!mkdir($layoutsDir, 0777, true) &amp;&amp; !is_dir($layoutsDir)) {\r\n            throw new \\RuntimeException(sprintf('Directory \"%s\" was not created', $layoutsDir));\r\n        }\r\n        $moduleName = $this-&gt;request-&gt;getModuleName();\r\n        $controller = $this-&gt;request-&gt;getControllerName();\r\n        $action = $this-&gt;request-&gt;getActionName();\r\n        $time = date('Y-m-d H:i:s');\r\n        $xml = $observer-&gt;getEvent()-&gt;getLayout()-&gt;getXmlString();\r\n        $fileName = $moduleName . '_' . $controller . '_' . $action . ' ' . $time . '.xml';\r\n        $fopen = fopen($layoutsDir . $fileName, 'ab+');\r\n        fwrite($fopen, $xml . PHP_EOL);\r\n        fclose($fopen);\r\n        return $this;\r\n    }\r\n}<\/pre>\n<p>As a result, we will get the xml layout files of the visited pages:<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/07\/XML-layout-of-the-visited-pages.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-16606\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/07\/XML-layout-of-the-visited-pages.jpg\" alt=\"XML layout of the visited pages\" width=\"504\" height=\"336\" title=\"Magento Layout: Module Layout Handles in Magento 2\"><\/a><\/p>\n<p>This is how you can look at the layout xml of the page we are interested in and see all the instructions contained.<\/p>\n<p>catalog_category_view&nbsp;for 2.2.3 sd:<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/07\/8c0d4d021c.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-16607\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/07\/8c0d4d021c.jpg\" alt=\"catalog category view for 2.2.3 sd\" width=\"1611\" height=\"857\" title=\"Magento Layout: Module Layout Handles in Magento 2\"><\/a><\/p>\n<h2 data-pm-slice=\"1 1 []\">Best Practices for Creating Layouts<\/h2>\n<p>Creating effective layouts in Magento requires a combination of technical skills and design expertise. Here are some best practices to keep in mind when creating layouts:<\/p>\n<ul>\n<li>Organize your layout files and ensure they are easy to read by using clear, descriptive names and comments.<\/li>\n<li>Use the correct layout file type for the page you are creating, such as a page layout file or a page configuration file.<\/li>\n<li>Use containers and blocks to create a structured and flexible layout that can be easily customized.<\/li>\n<li>Test your layouts thoroughly to ensure that they are working as expected and do not contain any errors.<\/li>\n<li>Use the Magento 2 layout validator to check your layout files for errors and provide feedback on how to fix them.<\/li>\n<\/ul>\n<p>By following these best practices, you can create effective and efficient layouts that enhance the user experience and improve the performance of your Magento 2 store.<\/p>\n<p>&nbsp;<\/p>\n<p>Hope this information was clear and useful to you. Please leave your questions in the comment section below and I will get in touch with you as soon as possible.<\/p>\n\n","protected":false},"excerpt":{"rendered":"Customizing a page using Module Layout Handles in Magento 2","protected":false},"author":82,"featured_media":16185,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[474,491,389,524],"tags":[],"class_list":["post-16173","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-ecommerce","category-magento-2","category-magento2-development","category-magento-speed-optimization","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Learn how to customize page elements in Magento 2 using Layout handles XML files, overriding module and theme layouts.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Andrey Litvin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#article\",\"name\":\"How to Use Module Layout Handles in Magento 2 | BelVG Blog\",\"headline\":\"Magento Layout: Module Layout Handles in Magento 2\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Module-Layout-Handles-in-Magento-2.jpg\",\"width\":770,\"height\":433},\"datePublished\":\"2018-09-06T12:47:04+02:00\",\"dateModified\":\"2025-05-21T18:56:42+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#webpage\"},\"articleSection\":\"ECOMMERCE, Magento 2, Magento 2 Development, Magento Speed Optimization, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"position\":2,\"name\":\"Magento 2 Development\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#listItem\",\"name\":\"Magento Layout: Module Layout Handles in Magento 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#listItem\",\"position\":3,\"name\":\"Magento Layout: Module Layout Handles in Magento 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin\",\"name\":\"Andrey Litvin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Andrey Litvin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html\",\"name\":\"How to Use Module Layout Handles in Magento 2 | BelVG Blog\",\"description\":\"Learn how to customize page elements in Magento 2 using Layout handles XML files, overriding module and theme layouts.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Module-Layout-Handles-in-Magento-2.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html\\\/#mainImage\",\"width\":770,\"height\":433},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/module-layout-handles-in-magento-2.html#mainImage\"},\"datePublished\":\"2018-09-06T12:47:04+02:00\",\"dateModified\":\"2025-05-21T18:56:42+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Use Module Layout Handles in Magento 2 | BelVG Blog","description":"Learn how to customize page elements in Magento 2 using Layout handles XML files, overriding module and theme layouts.","canonical_url":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#article","name":"How to Use Module Layout Handles in Magento 2 | BelVG Blog","headline":"Magento Layout: Module Layout Handles in Magento 2","author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/Module-Layout-Handles-in-Magento-2.jpg","width":770,"height":433},"datePublished":"2018-09-06T12:47:04+02:00","dateModified":"2025-05-21T18:56:42+02:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#webpage"},"articleSection":"ECOMMERCE, Magento 2, Magento 2 Development, Magento Speed Optimization, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","position":2,"name":"Magento 2 Development","item":"https:\/\/belvg.com\/blog\/category\/magento2-development","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#listItem","name":"Magento Layout: Module Layout Handles in Magento 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#listItem","position":3,"name":"Magento Layout: Module Layout Handles in Magento 2","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author","url":"https:\/\/belvg.com\/blog\/author\/andrey-litvin","name":"Andrey Litvin","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Andrey Litvin"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#webpage","url":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html","name":"How to Use Module Layout Handles in Magento 2 | BelVG Blog","description":"Learn how to customize page elements in Magento 2 using Layout handles XML files, overriding module and theme layouts.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/06\/Module-Layout-Handles-in-Magento-2.jpg","@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html\/#mainImage","width":770,"height":433},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html#mainImage"},"datePublished":"2018-09-06T12:47:04+02:00","dateModified":"2025-05-21T18:56:42+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"16173","title":"How to Use Module Layout Handles in Magento 2 | #site_title","description":"Learn how to customize page elements in Magento 2 using Layout handles XML files, overriding module and theme layouts.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:07","updated":"2026-11-03 18:37:07"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento2-development\" title=\"Magento 2 Development\">Magento 2 Development<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMagento Layout: Module Layout Handles in Magento 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento 2 Development","link":"https:\/\/belvg.com\/blog\/category\/magento2-development"},{"label":"Magento Layout: Module Layout Handles in Magento 2","link":"https:\/\/belvg.com\/blog\/module-layout-handles-in-magento-2.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/16173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=16173"}],"version-history":[{"count":5,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/16173\/revisions"}],"predecessor-version":[{"id":29379,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/16173\/revisions\/29379"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/16185"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=16173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=16173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=16173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}