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
More flexibility in nested field conditions #783
Comments
A |
It would be an improvement but with 'parent' I don't think you would be able to access any grandparent fields. My ideal situation would be if I could use the handles of any ancestor fields, example in my case:
Not sure if that's possible but, if I remember correctly, the ACF plugin for WordPress does something like this and it is useful sometimes. |
Using the handle to mean any field at any position won't really work. You could easily have multiple fields named the same at multiple positions. For instance, within grid rows, or replicator sets. |
You're probably right but let me try to explain my thinking. I've updated my original structure above to show fieldsets. I was hoping that the conditional display code might be able to traverse its way up through the conditional field's ancestors and attempt to find the first corresponding fieldset (e.g. full_section.size). If a direct ancestor with the appropriate field is found then apply the conditional logic. I don't think there would ever be more than one ancestor field with the same name. Maybe I shouldn't be nesting fields so much though. 'parent' and 'root' should be enough if I keep things simple. This problem presented for one of my first Statamic builds which has some pretty gnarly nesting. |
I’m having a similar issue in a project currently, and a |
I worked on a way to add a |
Bug description
This probably isn't a bug. Let me know if I should move it to ideas.
I have a complicated page builder replicator:
I am trying to use field conditions to toggle the card_group.items fields, like so:
The above doesn't work. I have also tried
root.style
but I think root targets the top-level 'Sections' replicator.How to reproduce
See above.
Logs
No response
Versions
Statamic 3.3.7 Solo
Laravel 8.83.8
PHP 8.1.1
edalzell/blade-directives 3.7
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
No response
Additional details
No response
The text was updated successfully, but these errors were encountered: