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

How to implement conditional_logic? #488

Closed
prathamesh-gharat opened this issue Jun 19, 2023 · 2 comments
Closed

How to implement conditional_logic? #488

prathamesh-gharat opened this issue Jun 19, 2023 · 2 comments

Comments

@prathamesh-gharat
Copy link

prathamesh-gharat commented Jun 19, 2023

For fields created through PHP, the actual field name doesn't match the condition.
Example: In the DB the is_subheading_overridden is pageComponents_7_is_subheading_overridden

[
                'label' => 'Override Sub Heading?',
                'name' => 'is_subheading_overridden',
                'type' => 'true_false',
                'default_value' => 0,
                'ui' => 1
            ],
            [
                'label' => 'Sub Heading',
                'name' => 'subHeading',
                'type' => 'text',
                'required' => 0,
                'default_value' => 'Don\'t take our word for it',
                'conditional_logic' => [
                    [
                        [
                            'field' => 'is_subheading_overridden',
                            'operator' => '==',
                            'value' => 1
                        ]
                    ]
                ]
            ],
@MadFlip
Copy link
Contributor

MadFlip commented Jun 19, 2023

Hi @prathamesh-gharat, Flynt uses the acf-field-group-composer plugin, so you should use fieldPath instead of field. See here
https://github.com/flyntwp/acf-field-group-composer#conditional-logic

@MadFlip MadFlip closed this as completed Jun 19, 2023
@prathamesh-gharat
Copy link
Author

Oh thanks!
I had overlooked that fieldPath

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

No branches or pull requests

2 participants