Skip Navigation

[Resolved] repeating field groups

This support ticket is created 2 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Steve 2 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2183843

Hi I'd like to create some text that's conditioned on there being any content in a repeating field group. I'm using blocks and don't see that option there.

Is it possible some how?

Thanks

#2184377

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

If your goal is to check whether a repeatable field group entry exists or not for a post, you can use the "wpv-post-id" shortcode with the item attribute:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

Suppose, that you have a Book RFG repeating field group with slug "book-rfg", attached to the parent "Books" post type. The following shortcode, would return the ID of the first repeating field group entry from the current Book post. If no repeating field group exists, nothing will be returned:


[wpv-post-id item="@book-rfg.child"]

In your conditional block's advanced editor, you can use the same shortcode to build the condition manually, like this:


 ( ( '[wpv-post-id item="@book-rfg.child"]' gte '1' ) ) 

As a result, the contents of this conditional block will only show, if any repeatable field group entry exists, and if it doesn't exist, that content won't be shown.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2184641

Thanks so much _ Works perfectly. Appreciate the help

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.