Twig templates support
qzminski opened this issue · 4 comments
qzminski commented
The rsce_foobar.html.twig
templates seem to work fine, except when you try to extend the Contao base template:
{% extends “@Contao/content_element/_base.html.twig” %}
Then, you get the following error:
It's obviously related to the fact that this file is treated as a legacy template, and thus has a different context. Possible solutions:
- Copy-paste the required context from here: https://github.com/contao/contao/blob/796f20fb5e2d6db01f6d80b3820eff4c806b3be5/core-bundle/src/Controller/ContentElement/AbstractContentElementController.php#L85-L99
- Convert this element to a service controller: https://github.com/madeyourday/contao-rocksolid-custom-elements/blob/master/src/Element/CustomElement.php
ausi commented
2. Convert this element to a service controller…
As this would not be backwards compatible, I added forward compatibility by setting the required context in c69bf39 manually. Can you please try if the latest dev-master
works for you?
ausi commented
Released as version 2.4.7