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
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
Thanks so much _ Works perfectly. Appreciate the help