You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The desired output is an array of template files to use as the (purge) content configuration.
Initially the list of files is empty [].
It should first build a list of all template files in the reset-theme child magento2-default-theme.
Then, it checks the next theme in the hierarchy, which is themeB.
For any file in themeB that is also present in the magento2-default-theme, the file in themeB should replace the file from magento2-default-theme in the result list.
Any new file in themeB that is not also in magento-default-theme should be added to the list.
The result at this time is a list of all template files in themeB and magento2-default-theme following the Magento theme fallback.
Then, it checks the next theme in the hierarchy, which is themeA.
The same process that already was done for themeB now is done for themeA.
For any file in themeA that is also present in themeB or magento2-default-theme, the file in themeA should replace the file from the parent themes in the result list.
Any new file in themeA that is not present in one of the parent themes should be added to the list.
The final result is an array of all template files in the theme hierarchy according to the Magento theme fallback.
Ideally, the file types to check should be configurable, e.g. /*/templates/**/*.phtml would check for any templates in parent themes, /*/layout/**/*.xml would check for layouts etc - you get the idea.
The text was updated successfully, but these errors were encountered:
It would be useful to add a function to the library that adds templates from parent themes to the purge content fallback, if they are not overridden.
There is a non-generic example for this in the Advanced Purge Config docs.
The function for this library should determine the theme parent hierarchy up until
hyva-themes/magento2-reset-theme
.Here is a draft for the algorithm:
Assuming the theme hierarchy
themeA => themeB => magento2-default-theme => magento2-reset-theme
The desired output is an array of template files to use as the (purge) content configuration.
Initially the list of files is empty
[]
.It should first build a list of all template files in the reset-theme child
magento2-default-theme
.Then, it checks the next theme in the hierarchy, which is
themeB
.For any file in
themeB
that is also present in themagento2-default-theme
, the file inthemeB
should replace the file frommagento2-default-theme
in the result list.Any new file in
themeB
that is not also inmagento-default-theme
should be added to the list.The result at this time is a list of all template files in
themeB
andmagento2-default-theme
following the Magento theme fallback.Then, it checks the next theme in the hierarchy, which is
themeA
.The same process that already was done for
themeB
now is done forthemeA
.For any file in
themeA
that is also present inthemeB
ormagento2-default-theme
, the file inthemeA
should replace the file from the parent themes in the result list.Any new file in
themeA
that is not present in one of the parent themes should be added to the list.The final result is an array of all template files in the theme hierarchy according to the Magento theme fallback.
Ideally, the file types to check should be configurable, e.g.
/*/templates/**/*.phtml
would check for any templates in parent themes,/*/layout/**/*.xml
would check for layouts etc - you get the idea.The text was updated successfully, but these errors were encountered: