Skip Navigation

[Resolved] Repeatable field in HTML conditional GUI

This thread is resolved. Here is a description of the problem and solution.

Problem:
The Repeatable Fields Groups fields do not appear in the HTML Conditional GUI where we create conditions in Toolset.

Solution:
That's right, currently, you can only check on Repeatable Field Groups fields crafting the HTML Conditional manually.
You can see here the precise approach:
https://toolset.com/forums/topic/repeatable-field-labels/#post-1374867

The request was added to the Developers todo list, to add Repeatable Field Groups fields to the HTML GUI.

This support ticket is created 5 years, 3 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by mikeH-3 5 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#1374835

Since conditional display does not work for repeatable fields, how do I hide the labels of these repeatable fields if they are empty? hidden link So basically if a member doesn't fill out birthday, I don't want the birthday label there showing. Normally I wrap everything in a conditional statement to pull this off but because those fields there are part of a repeatable group, I can't seem to do that. Any ideas what to do? I've searched past articles on here and nothing seems to apply.

#1374867

Why do you mean HTML Conditional display does not work for RFG fields?

You just apply the HTML conditions like you'd do on "normal" fields.

1. Create a RFG for a Post Type and add several fields
2. Create few Posts with the RFGs and create several RFGs with several fields filled or not filled
3. Create a View that displays the RFG post type and in the Loop, apply HTML conditional on the fields.

Hence, assuming a Single Line within an RFG that belongs to native Posts, the condition in the View Loop would look like this:

[wpv-conditional if="( $(wpcf-single-field-from-rfg-slug) ne '' )"]Yes it has a field value in the RFG and it is: [types field='single-field-from-rfg-slug'][/types][/wpv-conditional]

I think, what you mean is that you cannot find the Field of the RFG in the GUI when you actually create the conditional with the "conditional display" button.
I escalated that as an improvement to be made, as I can confirm that.

Please let me know if I missed anything

Thanks!

#1374893

Yes that is correct, the repeatable fields weren't in the dropdown so for us non programmers, it made it seem like it wasn't possible. But the code you gave did the trick.

Thanks!