-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Tokens in File Include Insert Tag don't get filled #330
Comments
Sorry but I cannot follow your issue. Can you post some concrete examples of what you did and what you expect? Maybe with screenshots? Why would tinyMCE strip any |
No problem. I guess I wasn't precise with „get stripped out“. This code
leads to:
|
Okay, that's kind of expected because tinyMCE tries to generate valid HTML, right. But that's always been the case and nothing we can do about that. So what exactly changed in NC2? |
To avoid this tinyMCE behaviour we added a file include insert tag to the HTML mail text like: So, if this won't work anymore what do you suggest to add conditions to html mail templates? |
I've never used the
this? |
I think the issue is that NC 2.0 does not replace insert tags and tokens recursively anymore. |
@Toflar That's right. We just copied the markup over to an external file to avoid TinyMCE.
Would it be an option to deactivate the TinyMCE for the HTML part of the mail via DCA update? |
To restore the original behavior a |
I know. I just wanted to understand the use case. Which I'm not quite sure about here. Probably needs a bit of time to think about. |
Hi @Toflar, are there any new insights since last week? |
I was on vacation and will check this soon. |
TLDR: we assessed the risk of re-introducing the behavior of NC v1 and decided against it. So I looked into the issue and discussed with @aschempp for quite a long time and we don't want to change this behavior for security reasons. Recursive replacing tokens could be dangerous as it might lead to unwanted information leakage. Imagine a user entering You have multiple options:
|
Hey Yanick, thanks for clarification and assessment from the developer's perspective. For our case we think about another pragmatic solution. TinyMCE replaces the if statements only if we put them around table rows inside the table tag. If statements should not be replaced if we put them around a separate table with complete markup. |
Hi,
current setup: NC 2, Contao 4.13.43
We use a file include insert tag {{file::filename.php}} to use a more complex html layout with conditional sections dependant on user input. These conditional statements (
{if form_field=="valueA"}{endif}
) would get stripped out by tinyMCE on save, so we did it via file include.With NC1 it worked like a charm and tokens got filled, after upgrading to NC2 (Pro) it doesn't work anymore.
If I put the HTML directly into the HTML field in mail settings tokens get filled but then our conditions are stripped out.
Is this a bug in NC2 or desired behaviour? And how can I add conditional output to HTML templates?
Cheers, Christian
The text was updated successfully, but these errors were encountered: