-
-
Notifications
You must be signed in to change notification settings - Fork 84
Support for comma-separated configuration paths #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
19488e0 to
48e73ec
Compare
|
@cweiske Wow, cool. I will have a look when I have a quiet minute. How does this work when saving elements? Where are they saved, if you have multiple paths? |
The first folder is used: daf1356#diff-88f27f4c106366588303ce7281dcf9e3aea68ad34a208c40cee3ff2d71de4300 |
|
So, what if you edit an element that is not located in that location? is it even possible to edit those? |
Good point. Currently it will write a new file at the first directory, even if the file already exists in the second dir. |
.. for the extension configuration options "backend_layouts_folder" and "content_elements_folder".
backend, content, layouts, layouts_backend, partials, partials_backend, preview
48e73ec to
291b4fe
Compare
|
I've updated the split loader to overwrite existing files when they exist. |
|
Now that mask has been deprecated with commit 2869a47, is there a future for this patch? |
|
@cweiske I am not working actively on Mask anymore and I don't have resources to review your patch. Are you using this feature for yourself? |
|
Yes, I built it because we need and use it in a project. |
|
@cweiske Ok, we can maybe think of adding this feature after it has been tested thoroughly in your project. But then you are responsible for any bugs/fixes which may come up. |
|
We've been using this patch on production for several months now and found no issues. |
As Mask is now deprecated, I would prefer not to merge a new feature. I think it is feasible to maintain a branch with this feature. Mask won't receive many patches, and if, then only small bugfixes. |
This patch adds support for loading templates from multiple directories by specifying comma-separated paths in each of the mask extension configuration options:
backend,backend_layouts_folder,content,content_elements_folder,layouts,layouts_backend,partials,partials_backend,preview.config/system/settings.php:Use case
We have multiple site packages, one for each root page in the TYPO3 instance.
Each site has own content elements.
Mask currently does not support loading content elements from multiple sources.
Possible solutions
In #487, a custom json loader was suggested, which would solve the multiple-paths problem for
backend_layouts_folderandcontent_elements_folder.Defining additional frontend rendering paths (
content,layout,partials) is possible with TypoScript.The remaining problem are backend previews and content element icons:
backend,layouts_backend,partials_backendandpreview- those cannot be adjusted to support multiple paths without modifying mask itself.Solution
The patches here add support for loading templates from multiple directories by specifying comma-separated paths in each of the mask extension configuration options.
The first commit modifies the json-split-loader, the second adds comma-separated path support for all the other extension configuration options.
Even if the loader can be overridden and some additional paths can be definined with TypoScript, I think it is sensible to add support for multiple paths to all configuration options instead of only those that cannot be changed externally.
I've extended the unit tests for all modified code parts that already had tests.
Related to #487.