I have a CPT called 'reps' each rep is a company, and each company has multiple contacts. So i created a repeatable field group called company contacts, and displayed it on the front end with a view.
just above the view I have a header that says 'Contact Somone' and i want this to conditionally hide if there are no contacts inputted into the repeatable field group. in other words i want the heading to hide conditionally if there is no data in the repeatable field group.
I see that i can use the 'fields and text' block to creation conditions, however i do not see the field group in the list of fields to make a condition from.
link to login: hidden link
link to content template: hidden link
Hello, I see what you mean - you would need a way to set up a conditional to test the number of results in your View of the RFG. Unfortunately this isn't very simple to achieve in the Block Editor. If you're comfortable working with shortcodes, I can show you how to use Classic Views to achieve this type of conditional display. Let me know if that's something you would like to pursue.
yes, comfortable with shortcodes and some php - just new to toolset. yes, please explain away!
Okay if you go to Toolset > Settings > General you can enable the classic Views interface by choosing " Show both the legacy and Blocks interface and let me choose which to use for each item I build" in the Editing experience settings. That will give you access to a new Views menu item. Create a new View and choose your RFG as the Content Selection. Add a post relationship Query Filter so the View only shows those RFGs related to the post where this View is shown. Then use the Loop Wizard to build your design with the Block Editor if you'd like.
Once that is done, in the Loop Editor panel, you can add your header text just after the wpv-items-found block. This isn't possible in the Block Editor, but in the Classic Editor you can add content that will display if any results are found, but outside the loop. Once your View is complete, you can add it to your template using a Views block. Let me know if you have questions about this.
My issue is resolved now. Thank you!