...
- same block comment, that each template file has
- separate file, created per-folder (like .smsignore)
- single per-theme file in theme root folder
- single per-theme file in theme /install/ sub-folder (we already have theme.xml file there)
Solution
- change the "
c:
OnAfterRebuildThemes
" event to unserialize values of "$files
" array (all at once) before using them later - create the "
CategoriesEventHandler::sortByDependencies(array $files)
" method, that will:- accept $files associative array, that is built in "
c:OnAfterRebuildThemes
" event, where:- key is relative path to a template in theme
- value is array, that was parsed from template meta comment
- for each array entry (the template file) build a sorting key like this:
- take array from "section" key of template info (if missing use empty array)
- append value of "name" key to that array (if missing use
'_Auto: ' . $template
) - combine using a separator (e.g. "||")
- sort array using sort key built above (will ensure, that parent templates will be listed prior to child templates)
- return sorted "$files" array
- accept $files associative array, that is built in "
- in the "
c:
OnAfterRebuildThemes
" event call the "CategoriesEventHandler::sortByDependencies
" method on the "$files
" array prior to creating categories from it
Related Tasks