{"id":13598,"date":"2017-06-27T16:52:55","date_gmt":"2017-06-27T13:52:55","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=13598"},"modified":"2025-02-11T10:43:15","modified_gmt":"2025-02-11T08:43:15","slug":"collecting-xml-theme-files-in-magento-2","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html","title":{"rendered":"Collecting XML Theme Files in Magento 2"},"content":{"rendered":"\n<p><span style=\"font-weight: 400;\">In order to get onto the issue, let&rsquo;s have a look at the method <em>loadFileLayoutUpdatesXml()<\/em> of the class <\/span><span style=\"font-weight: 400;\"><em>Magento\\Framework\\View\\Model\\Layout\\Merge<\/em>. <\/span><\/p>\n<p><!--more--><\/p>\n<pre class=\"lang:php decode:true\">\/**\r\n\t* Collect and merge layout updates from files\r\n\t*\r\n\t* @return \\Magento\\Framework\\View\\Layout\\Element\r\n\t* @throws \\Magento\\Framework\\Exception\\LocalizedException\r\n\t*\/\r\n\tprotected function _loadFileLayoutUpdatesXml()\r\n\t{\r\n       $layoutStr = '';\r\n   \t$theme = $this-&gt;_getPhysicalTheme($this-&gt;theme);\r\n\t...\r\n<\/pre>\n<p><span style=\"font-weight: 400;\">As for me, I use Magento 2.1.7, so in the picture, we can see the variable <em>$theme<\/em> that contains theme data. In my case, there are data concerning default theme &ldquo;Magento Luma&rdquo;.<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-theme-files-in-Magento-2__1.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy alignnone size-full wp-image-13607\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-theme-files-in-Magento-2__1.jpg\" alt=\"Collecting XML theme files in Magento 2__1\" width=\"1383\" height=\"788\" title=\"Collecting XML Theme Files in Magento 2\"><\/a><\/p>\n<pre class=\"lang:php decode:true\">$updateFiles = $this-&gt;fileSource-&gt;getFiles($theme, '*.xml');\r\n<\/pre>\n<div class=\"content_sales_info\" style=\"background-image: url(https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/03\/Sales_background.png\"><img width=\"65\" height=\"65\" src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/03\/Igor-Dragun1.png\" alt=\"Igor Dragun\" title=\"Collecting XML Theme Files in Magento 2\"><div class=\"content_part\"><h3 class=\"title\">Partner With Us <\/h3><span class=\"sales_content_text\">Let's discuss how to grow your business. Get a Free Quote.<\/span><\/div> <a class=\"call-to-action\" href=\"https:\/\/belvg.com\/contact?utm_source=blog&amp;utm_campaign=sales_block&amp;utm_content=middle\" target=\"_blank\" rel=\"noopener\">Talk to Igor<\/a><\/div>\n<p><span style=\"font-weight: 400;\">On the stage, we get all XML files with the help of the method <em>getFiles<\/em> placed in the class <\/span><span style=\"font-weight: 400;\"><em>\\lib\\internal\\Magento\\Framework\\View\\Layout\\File\\Collector\\Aggregated<\/em>. Let&rsquo;s have a closer look at the method to comprehend how it works.<\/span><\/p>\n<pre class=\"lang:php decode:true\">\/**\r\n* Retrieve files\r\n*\r\n* Aggregate layout files from modules and a theme and its ancestors\r\n*\r\n* @param ThemeInterface $theme\r\n* @param string $filePath\r\n* @return \\Magento\\Framework\\View\\File[]\r\n*\/\r\npublic function getFiles(ThemeInterface $theme, $filePath)\r\n{\r\n&nbsp;&nbsp;&nbsp; $list = $this-&gt;fileListFactory-&gt;create();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$list-&gt;add($this-&gt;baseFiles-&gt;getFiles($theme, $filePath));\r\n&nbsp;&nbsp;&nbsp; foreach ($theme-&gt;getInheritedThemes() as $currentTheme) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$list-&gt;add($this-&gt;themeFiles-&gt;getFiles($currentTheme, $filePath));\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$list-&gt;replace($this-&gt;overrideBaseFiles-&gt;getFiles($currentTheme, $filePath));\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$list-&gt;replace($this-&gt;overrideThemeFiles-&gt;getFiles($currentTheme, $filePath));\r\n&nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; return $list-&gt;getAll();\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">Here we create a list where pathways should be added to XML files. As before, it&rsquo;s not clear where Magento finds XML files. Let&rsquo;s define what is the method <\/span><span style=\"font-weight: 400;\"><em>getFiles<\/em> of the class<\/span><em><span style=\"font-weight: 400;\"> \/<\/span><\/em><span style=\"font-weight: 400;\"><em>lib\/internal\/Magento\/Framework\/View\/File\/Collector\/Decorator\/ModuleDependency<\/em> makes:<\/span><\/p>\n<pre class=\"lang:php decode:true\">\/**\r\n* Retrieve view files, sorted by the priority of modules they belong to\r\n*\r\n* @param ThemeInterface $theme\r\n* @param string $filePath\r\n* @return \\Magento\\Framework\\View\\File[]\r\n*\/\r\npublic function getFiles(ThemeInterface $theme, $filePath)\r\n{\r\n&nbsp;&nbsp;&nbsp; $result = $this-&gt;subject-&gt;getFiles($theme, $filePath);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usort($result, [$this, 'compareFiles']);\r\n&nbsp;&nbsp;&nbsp; return $result;\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">As you can see, the method is considered as significant and simple. So we should learn one more method <em>getFiles<\/em> of the class <\/span><span style=\"font-weight: 400;\"><em>\/lib\/internal\/Magento\/Framework\/View\/File\/Collector\/Decorator\/ModuleOutput<\/em>:<\/span><\/p>\n<pre class=\"lang:php decode:true\">\/**\r\n* Retrieve files\r\n*\r\n* Filter out theme files that belong to inactive modules or ones explicitly configured to not produce any output\r\n*\r\n* @param ThemeInterface $theme\r\n* @param string $filePath\r\n* @return \\Magento\\Framework\\View\\File[]\r\n*\/\r\npublic function getFiles(ThemeInterface $theme, $filePath)\r\n{\r\n&nbsp;&nbsp;&nbsp; $result = [];\r\n&nbsp;&nbsp;&nbsp; foreach ($this-&gt;subject-&gt;getFiles($theme, $filePath) as $file) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($this-&gt;moduleManager-&gt;isOutputEnabled($file-&gt;getModule())) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result[] = $file;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; return $result;\r\n}<\/pre>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento2-development\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><div class=\"module_content_part\"><h3 class=\"title\">Magento 2 Development<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento 2 Development<\/p><a href=\"https:\/\/belvg.com\/magento2-development\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n<p><span style=\"font-weight: 400;\">As it is mentioned in the code, from the list of all modules we leave only active. Let&rsquo;s continue reviewing the method <em>getFiles<\/em> of the class <\/span><span style=\"font-weight: 400;\"><em>Magento\/Framework\/View\/File\/Collector\/Base<\/em>:<\/span><\/p>\n<pre class=\"lang:php decode:true\">\/**\r\n* Retrieve files\r\n*\r\n* @param \\Magento\\Framework\\View\\Design\\ThemeInterface $theme\r\n* @param string $filePath\r\n* @return \\Magento\\Framework\\View\\File[]\r\n*\/\r\npublic function getFiles(ThemeInterface $theme, $filePath)\r\n{\r\n&nbsp;&nbsp;&nbsp; $result = [];\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sharedFiles = $this-&gt;componentDirSearch-&gt;collectFilesWithContext(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ComponentRegistrar::MODULE,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"view\/base\/{$this-&gt;subDir}{$filePath}\"\r\n&nbsp;&nbsp;&nbsp; );\r\n&nbsp;&nbsp;&nbsp; foreach ($sharedFiles as $file) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result[] = $this-&gt;fileFactory-&gt;create($file-&gt;getFullPath(), $file-&gt;getComponentName(), null, true);\r\n&nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; $area = $theme-&gt;getData('area');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$themeFiles = $this-&gt;componentDirSearch-&gt;collectFilesWithContext(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ComponentRegistrar::MODULE,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"view\/{$area}\/{$this-&gt;subDir}{$filePath}\"\r\n&nbsp;&nbsp;&nbsp; );\r\n&nbsp;&nbsp;&nbsp; foreach ($themeFiles as $file) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result[] = $this-&gt;fileFactory-&gt;create($file-&gt;getFullPath(), $file-&gt;getComponentName());\r\n&nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; return $result;\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">Here we can find something interesting. Let&rsquo;s learn how XML files are collected:<\/span><\/p>\n<pre class=\"lang:php decode:true\">...\r\n$sharedFiles = $this-&gt;componentDirSearch-&gt;collectFilesWithContext(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ComponentRegistrar::MODULE,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"view\/base\/{$this-&gt;subDir}{$filePath}\"\r\n&nbsp;&nbsp;&nbsp; );\r\n&hellip;\r\n$area = $theme-&gt;getData('area');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$themeFiles = $this-&gt;componentDirSearch-&gt;collectFilesWithContext(\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ComponentRegistrar::MODULE,\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"view\/{$area}\/{$this-&gt;subDir}{$filePath}\"\r\n&nbsp;&nbsp;&nbsp; );\r\n...<\/pre>\n<p><span style=\"font-weight: 400;\">Where:<\/span><\/p>\n<p>$area &ndash; frontend<br>\n$this-&gt;subDir &ndash; ui_componen\/<br>\n$filePath &ndash; etc\/definition.xml<\/p>\n<p><span style=\"font-weight: 400;\">First of all, we get the XML file of the pathway <\/span><span style=\"font-weight: 400;\">&ldquo;view\/base\/ui_componen\/etc\/definition.xml&rdquo;. Then it&rsquo;s necessary to get the XML file of the pathway &ldquo;view\/frontend\/ui_componen\/etc\/definition.xml&rdquo;.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The method <em>collectFilesWithContext<\/em> of the class <em>Magento\\Framework\\Component\\DirSearch<\/em> gets the list of files in the definite directory back. Even a needed file can be given back, as in our case.&nbsp;<\/span><span style=\"font-weight: 400;\">As a result, we have &ldquo;view\/base\/ui_component\/etc\/definition.xml&rdquo; file in <em>$sharedFiles<\/em> array. While <em>$themeFiles<\/em> array is empty, as the file has not been created on the way. Therefore, we get a file where all UI components have a base declaration.<\/span><\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento-webdesign\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/magento-webdesign-1.png\" width=\"100\" height=\"100\" alt=\"magento webdesign\" class=\"module_image\" title=\"Collecting XML Theme Files in Magento 2\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Webdesign<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento webdesign<\/p><a href=\"https:\/\/belvg.com\/magento-webdesign\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n<p><span style=\"font-weight: 400;\">It&rsquo;s high time to return to the <em>method _loadFileLayoutUpdatesXml<\/em> we started with. The following line is in it:<\/span><\/p>\n<pre class=\"lang:php decode:true\">...\r\n$updateFiles = array_merge($updateFiles, $this-&gt;pageLayoutFileSource-&gt;getFiles($theme, '*.xml'));\r\n...<\/pre>\n<p><span style=\"font-weight: 400;\">Since we know the whole pathway consisting of some getFiles methods, let&rsquo;s jump of <em>Magento\/Framework\/View\/File\/Collector\/Base::getFiles<\/em><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now we get XML of not a definite XML file, but all XML files in the directory &ldquo;view\/base\/layout\/&rdquo;.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&rsquo;s have a look at the screenshots and define what is contained in $sharedFiles:<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-theme-files-in-Magento-2__2.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy alignnone size-full wp-image-13608\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-theme-files-in-Magento-2__2.jpg\" alt=\"Collecting XML theme files in Magento 2__2\" width=\"939\" height=\"514\" title=\"Collecting XML Theme Files in Magento 2\"><\/a><\/p>\n<p><span style=\"font-weight: 400;\">As a result, we get XML files of the directory &ldquo;view\/frontend\/layout\/&rdquo;. <\/span><span style=\"font-weight: 400;\">Let&rsquo;s look at the second screenshot and define what is contained in <em>$themeFiles<\/em>:<\/span><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-theme-files-in-Magento-2__3.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy alignnone size-medium wp-image-13609\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-theme-files-in-Magento-2__3.jpg\" alt=\"Collecting XML theme files in Magento 2__3\" width=\"960\" height=\"587\" title=\"Collecting XML Theme Files in Magento 2\"><\/a><\/p>\n<p><span style=\"font-weight: 400;\">We have all xml files of the theme. Let&rsquo;s summarize which files we&rsquo;ve got for further processing:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&lt;Magento_Theme_module_dir&gt;\/view\/base\/ui_component\/etc\/definition.xml<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&lt;Magento_Theme_module_dir&gt;\/view\/frontend\/ui_component\/etc\/definition.xml<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&lt;Magento_Theme_module_dir&gt;\/view\/base\/layout\/*<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">&lt;Magento_Theme_module_dir&gt;\/view\/frontend\/layout\/*<\/span><\/li>\n<\/ul>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento-custom-development\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/magento-custom-development.png\" width=\"120\" height=\"120\" alt=\"magento custom development\" class=\"module_image\" title=\"Collecting XML Theme Files in Magento 2\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Custom Development<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento Custom Development <\/p><a href=\"https:\/\/belvg.com\/magento-custom-development\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"In order to get onto the issue, let&#8217;s have a look at the method loadFileLayoutUpdatesXml() &#8230;","protected":false},"author":58,"featured_media":13605,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[35,14,389,471],"tags":[],"class_list":["post-13598","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-certification","category-magento","category-magento2-development","category-magento-developer","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=\"In order to get onto the issue, let\u2019s have a look at the method loadFileLayoutUpdatesXml() of the class MagentoFrameworkViewModelLayoutMerge.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Aleksander Kutseika\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-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\\\/collecting-xml-theme-files-in-magento-2.html#article\",\"name\":\"Collecting XML Theme Files in Magento 2 | BelVG Blog\",\"headline\":\"Collecting XML Theme Files in Magento 2\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/Collecting-XML-Theme-Files-in-Magento-2.jpg\",\"width\":700,\"height\":290,\"caption\":\"Collecting XML Theme Files in Magento 2\"},\"datePublished\":\"2017-06-27T16:52:55+02:00\",\"dateModified\":\"2025-02-11T10:43:15+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#webpage\"},\"articleSection\":\"Certification, Magento, Magento 2 Development, Magento Developer, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-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\\\/magento#listItem\",\"name\":\"Magento\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"position\":2,\"name\":\"Magento\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#listItem\",\"name\":\"Collecting XML Theme Files in Magento 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#listItem\",\"position\":3,\"name\":\"Collecting XML Theme Files in Magento 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}}]},{\"@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\\\/aleksander-kutseika#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika\",\"name\":\"Aleksander Kutseika\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Aleksander Kutseika\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html\",\"name\":\"Collecting XML Theme Files in Magento 2 | BelVG Blog\",\"description\":\"In order to get onto the issue, let\\u2019s have a look at the method loadFileLayoutUpdatesXml() of the class MagentoFrameworkViewModelLayoutMerge.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/Collecting-XML-Theme-Files-in-Magento-2.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html\\\/#mainImage\",\"width\":700,\"height\":290,\"caption\":\"Collecting XML Theme Files in Magento 2\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/collecting-xml-theme-files-in-magento-2.html#mainImage\"},\"datePublished\":\"2017-06-27T16:52:55+02:00\",\"dateModified\":\"2025-02-11T10:43:15+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":"Collecting XML Theme Files in Magento 2 | BelVG Blog","description":"In order to get onto the issue, let\u2019s have a look at the method loadFileLayoutUpdatesXml() of the class MagentoFrameworkViewModelLayoutMerge.","canonical_url":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-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\/collecting-xml-theme-files-in-magento-2.html#article","name":"Collecting XML Theme Files in Magento 2 | BelVG Blog","headline":"Collecting XML Theme Files in Magento 2","author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-Theme-Files-in-Magento-2.jpg","width":700,"height":290,"caption":"Collecting XML Theme Files in Magento 2"},"datePublished":"2017-06-27T16:52:55+02:00","dateModified":"2025-02-11T10:43:15+02:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#webpage"},"articleSection":"Certification, Magento, Magento 2 Development, Magento Developer, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-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\/magento#listItem","name":"Magento"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","position":2,"name":"Magento","item":"https:\/\/belvg.com\/blog\/category\/magento","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#listItem","name":"Collecting XML Theme Files in Magento 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#listItem","position":3,"name":"Collecting XML Theme Files in Magento 2","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}}]},{"@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\/aleksander-kutseika#author","url":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika","name":"Aleksander Kutseika","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Aleksander Kutseika"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#webpage","url":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html","name":"Collecting XML Theme Files in Magento 2 | BelVG Blog","description":"In order to get onto the issue, let\u2019s have a look at the method loadFileLayoutUpdatesXml() of the class MagentoFrameworkViewModelLayoutMerge.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/06\/Collecting-XML-Theme-Files-in-Magento-2.jpg","@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html\/#mainImage","width":700,"height":290,"caption":"Collecting XML Theme Files in Magento 2"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html#mainImage"},"datePublished":"2017-06-27T16:52:55+02:00","dateModified":"2025-02-11T10:43:15+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":"13598","title":"Collecting XML Theme Files in Magento 2 | #site_title","description":"In order to get onto the issue, let\u2019s have a look at the method loadFileLayoutUpdatesXml() of the class MagentoFrameworkViewModelLayoutMerge.","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:17","updated":"2026-11-03 18:37:17"},"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\/magento\" title=\"Magento\">Magento<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCollecting XML Theme Files in Magento 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento","link":"https:\/\/belvg.com\/blog\/category\/magento"},{"label":"Collecting XML Theme Files in Magento 2","link":"https:\/\/belvg.com\/blog\/collecting-xml-theme-files-in-magento-2.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/13598","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\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=13598"}],"version-history":[{"count":5,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/13598\/revisions"}],"predecessor-version":[{"id":28764,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/13598\/revisions\/28764"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/13605"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=13598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=13598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=13598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}