You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happened after #8956 was released. When using the {{ nocache }} tag, variables are only available inside the tag, if their value was directly used, but not, if they are only used within if statements. The also get ignored, when used (even when simply outputting the value) within a partial inside the nocache tag.
To me this seems like an unwanted breaking change. Do you think it is possible to fix this issue?
As a workaround, you can specify the variables you want to use with the select parameter:
{{ nocache select="variable_name|another|foo" }}
<!-- And your code here -->
{{ /nocache }}
morhi
changed the title
Recent {{ nocache }} tag improvements seem to ignore variable usages in if statements
Recent {{ nocache }} tag improvements seem to ignore variable usages in if statements or usages within partials
Dec 5, 2023
Bug description
This happened after #8956 was released. When using the
{{ nocache }}
tag, variables are only available inside the tag, if their value was directly used, but not, if they are only used withinif
statements. The also get ignored, when used (even when simply outputting the value) within a partial inside thenocache
tag.To me this seems like an unwanted breaking change. Do you think it is possible to fix this issue?
How to reproduce
if
within thenocache
tag will not trigger the variable to be stored for thenocache
context. This would work though:Of course, it would output the value of the variable, which I don't want.
Possible workaround: Using the
{{ nocache select="show_me" }}
syntax instead.Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
runtime (new)
Additional details
No response
The text was updated successfully, but these errors were encountered: