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
Currently, there is no way to expose all parameters passed to a partial without explicitly knowing the parameters you're passing down. It's possible to look at the view but these look to be merged with the current context, polluting the possible parameters with ones that have been passed previously (nested components, for example, but we also came across this issue with the {{ nocache }} tags returning a different context)
We already know the parameters used on just that partial and we're getting them using the special__frontmatter key. However, this is overwritten somewhere down the line but I couldn't find where.
I think it would be good to create another variable, that isn't touched by anything else. Gives us the ability to not worry about scoping, view context etc. We know explicitly what parameters have been passed to that partial.
'__params' => $this->params->all(),
How to reproduce
Just a little test between __frontmatter and __params. You'll find the __frontmatter returns empty arrays.
Bug description
Currently, there is no way to expose all parameters passed to a partial without explicitly knowing the parameters you're passing down. It's possible to look at the
view
but these look to be merged with the current context, polluting the possible parameters with ones that have been passed previously (nested components, for example, but we also came across this issue with the{{ nocache }}
tags returning a different context)We already know the parameters used on just that partial and we're getting them using the special
__frontmatter
key. However, this is overwritten somewhere down the line but I couldn't find where.cms/src/Tags/Partial.php
Line 25 in f52ea08
I think it would be good to create another variable, that isn't touched by anything else. Gives us the ability to not worry about scoping, view context etc. We know explicitly what parameters have been passed to that partial.
How to reproduce
Just a little test between
__frontmatter
and__params
. You'll find the__frontmatter
returns empty arrays.partial.antlers.html
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: