#28468 closed Uncategorized (invalid)
Template braces within {% include ... with="..." %} are not evaluated
Reported by: | Liquid Scorpio | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I am not sure if this is a bug or limitation, I will add here anyways.
Consider following code inside a django template:
{% include 'partials/_message.html' with message_title="Unauthorised" message_body="You need <strong>{{ perm_name }}</strong> permission to access the content." %}
The issue is related to the output rendered in browser for *message_body* when {% include %} is executed.
Expected output:
You need read permission to access the content.
Actual output:
You need {{ perm_name }} permission to access the content.
Notes
While the included template evaluates the passed in <strong> tag, it does not evaluate the variable {{ perm_name }} and outputs it verbatim.
Change History (3)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Summary: | Template braces within {% with %} are not evaluated → Template braces within {% include ... with="..." %} are not evaluated |
Note:
See TracTickets
for help on using tickets.
I think the current behavior is the expected behavior.
"You need <strong>{{ perm_name }}</strong> permission to access the content."
is a string literal.