Skip to content
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

Twig templates support #165

Closed
qzminski opened this issue Feb 21, 2024 · 4 comments
Closed

Twig templates support #165

qzminski opened this issue Feb 21, 2024 · 4 comments
Assignees

Comments

@qzminski
Copy link
Contributor

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:

CleanShot 2024-02-21 at 12 49 00@2x

It's obviously related to the fact that this file is treated as a legacy template, and thus has a different context. Possible solutions:

  1. Copy-paste the required context from here: https://github.com/contao/contao/blob/796f20fb5e2d6db01f6d80b3820eff4c806b3be5/core-bundle/src/Controller/ContentElement/AbstractContentElementController.php#L85-L99
  2. Convert this element to a service controller: https://github.com/madeyourday/contao-rocksolid-custom-elements/blob/master/src/Element/CustomElement.php
@ausi ausi closed this as completed in c69bf39 Feb 25, 2024
@ausi
Copy link
Member

ausi commented Feb 25, 2024

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 ausi self-assigned this Feb 25, 2024
@ausi
Copy link
Member

ausi commented Feb 25, 2024

Regarding the switch to fragment controllers, see #162

@qzminski
Copy link
Contributor Author

@ausi looks good at first sight, thanks!

@ausi
Copy link
Member

ausi commented Feb 26, 2024

Released as version 2.4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants