-
Notifications
You must be signed in to change notification settings - Fork 9
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
EZP-24765: Give possibility to set additional paths for a given theme #5
Conversation
Ping @andrerom @bdunogier |
doc/templates.md
Outdated
template_theme_paths: | ||
# FOSUserBundle templates will be part of "my_theme" theme | ||
my_theme: | ||
- '%kernel.root_dir%/../vendor/friendsofsymfony/user-bundle/Resources/views' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On sf 3.3 there is also kernel.project_dir
, but doesn't make much of a differance here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was tempted to use %kernel.project_dir%
but as we don't require Symfony 3.3 yet, I preferred using the old fashion way 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is hard.
->arrayNode('template_theme_paths') | ||
->useAttributeAsKey('theme') | ||
->example(['some_theme' => ['/var/foo/some_theme_dir', '/another/theme/dir']]) | ||
->info('Collection of template paths by theme.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'd make templates plural, and update the setting name. I know we've spent time on it, but it sounds wrong now :)
Funnily enough, it is reversed in the container parameter's name: ezdesign.templates_path_map
😉
doc/templates.md
Outdated
@@ -41,6 +41,25 @@ Default fallback order is the following: | |||
|
|||
> Bundle fallback order is the instantiation order in `AppKernel`. | |||
|
|||
### Additional theme paths | |||
In addition to the convention described above, it is also possible to add arbitrary Twig template directories to a theme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
templates ?
93e15f6
to
823b2ff
Compare
> https://jira.ez.no/browse/EZP-27465 This patch makes it possible to add arbitrary Twig template directories to a theme from configuration. This can be useful when you want to define templates from third-party bundles as part of one of your themes, or when upgrading your application in order to use eZ Platform design engine, and that your existing templates are not yet following the convention. Practical use case would be to define a `standard` theme for templates provided by the kernel. ```yaml ezdesign: design_list: my_design: [my_theme, some_other_theme] templates_theme_paths: # FOSUserBundle templates will be part of "my_theme" theme my_theme: - '%kernel.root_dir%/../vendor/friendsofsymfony/user-bundle/Resources/views' ```
823b2ff
to
d2eb415
Compare
@bdunogier Fixed |
@bdunogier ping ? 😃 |
This patch makes it possible to add arbitrary Twig template directories to a theme from configuration.
This can be useful when you want to define templates from third-party bundles as part of one of your themes, or when upgrading your application in order to use eZ Platform design engine, and that your existing templates are not yet following the convention.
Practical use case would be to define a
standard
theme for templates provided by the kernel.