Skip to content
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

[5.x] Page children as value for field conditions #11368

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

heidkaemper
Copy link
Contributor

This PR relates to #11080

Sometimes it would be helpful to conditionally render a field when the page is part of a structure and has / has not children.

if:
  children: 'not empty'

Or even something like this:

if:
  children: 'contains c534de98-24c8-479b-b1a0-0e8945b76020'

By the way, this PR started with the need for a has-children field condition. But I switched to children because I think it's a bit more flexible.

@jasonvarga jasonvarga merged commit 36c3b22 into statamic:5.x Jan 22, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants