• Resolved seccyeth

    (@seccyeth)


    Hi,
    I loved Custom Content Shortcode, and used it to display ACF relationship fields base on whether or not there were any relationships for my CPT.
    I achieved this by using <if> for the True/false value, and then displayed either the relationships field or a message.

    On the documentation, it looks like the ACF True/False is not implemented yet on Loops & Logic. Is it planned in a foreseeable future? Or is there a better way to achieve this with existing features?

    Thanks a lot for you great work, can’t wait to do the switch!

Viewing 1 replies (of 1 total)
  • Plugin Author Tangible

    (@tangibleinc)

    Hi! To test whether an ACF relationship field has a value you can use the following:

    <If loop acf_relationship=field_name>conditionally display this</If>
    You can test whether any loop returns something this way: by pasting the whole Loop with its attributes into an if tag and removing the capitalization on “Loop”

    If you’re manually using the ACF True / False field to hide or show your relationships, L&L supports that. The True / False field saves 1 for true or 0 for false, and that’s what it outputs when you get it with the Field tag in L&L (<Field field_name />) so you can test its value like this:
    <If field=field_name value=1>This is true<Else />This is false</If>

Viewing 1 replies (of 1 total)
  • The topic ‘ACF True/False support ?’ is closed to new replies.