-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Template preview mode for Twig templates #7140
Comments
This is even more complicated: there could be embedded templates, horizontal reuse etc. and blocks could be overwritten. However, our inspector system is already capable of recording the structure at compile time, so we could probably improve the experience. Keep in mind, that the Symfony profiler already tells you about the effectively rendered templates, so this might be a starting point. |
I think I need to clarify things a bit more with an example: Let's assume there is the
And depending on the complexity of the project, there could be more. Sometimes you need to jump from template to template to find the correct level of abstraction, that you want/decide to use for your adjustments. Its very similar to writing code - going up base classes and following dependencies. Having different levels of possible adjustments is something, that was not possible with the old framework, so you needed to overwrite everything all the time. If you are using PHPStorm with the Symfony plugin, you can already traverse templates and quickly find the right spot thanks to our |
Description
As discussed on the Contao camp, it is difficult to analyze the parent Twig templates when extending a template. This is the content of a new template added in the back end:
The available blocks come from 4 different templates:
_base.html.twig
_list.html.twig
_download.html.twig
downloads.html.twig
To really understand how to adjust the custom template, most developers want to look at the original templates, which is currently not possible in the back end. A possible solution would be a link to the original template on GitHub or a template preview mode in the back end.
The text was updated successfully, but these errors were encountered: