contao icon indicating copy to clipboard operation
contao copied to clipboard

Insert tags in FormExplanation are no longer replaced

Open aschempp opened this issue 2 years ago • 4 comments

Affected version(s)

5.2

Description

The form field "explanation" in the form generator no longer replaces insert tags. I guess this could be related because I'm using a Twig template for fe_page?

aschempp avatar Jan 24 '24 20:01 aschempp

Yeah, currently only the new content elements and modules using Twig also replace insert tags directly (whenever applicable). All legacy content elements and modules do not and instead rely on the system to replace it for them later on - which would normally be FrontendTemplate::compile(). But since you are using an fe_page.html.twig that's not applied of course. As a workaround you would need to use |insert_tag_raw (?) in your fe_page.html.twig.

fritzmg avatar Jan 25 '24 10:01 fritzmg

Is the form generator not using any (legacy) templates? Because then they should get replaced by the old template engine (only if you did not replace them with Twig templates as well).

m-vo avatar Jan 25 '24 13:01 m-vo

Widgets only use the TemplateInheritance and TemplateTrait traits. They do not replace insert tags.

fritzmg avatar Jan 25 '24 13:01 fritzmg

As discussed in the Contao call, we can probably fix this if we also check instanceof Widget && ->isFrontendRequest() here:

https://github.com/contao/contao/blob/72e255df17ed5340c0e7b94e5520b58bcfb115d8/core-bundle/contao/library/Contao/TemplateInheritance.php#L145-L147

leofeyer avatar Mar 07 '24 14:03 leofeyer