Tell us what you are trying to do?
I have the headings of "Sponsors", "Cast" and "Crew" for repeatable fields that you can see here. hidden link
I want to set up the page so if a section has no repeatable field used, the heading for the section disappears.
Is there any documentation that you are following?
https://toolset.com/forums/topic/hide-text-field-if-custom-field-is-empty/
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
I've tried these expressions with no luck. I'm wondering if the issue is because the field is repeatable.
[wpv-conditional if="(sponsor)"]
<h4>Sponsors</h4>
[/wpv-conditional]
[wpv-conditional if="( $(sponsor) eq '' )" ] [/wpv-conditional]
[wpv-conditional if="( $(sponsor) ne '' )"]
<h4>SPONSORS</h4>[/wpv-conditional]
[wpv-conditional if="( $(sponsor) ne '' )"]
[types field='director'][/types][/wpv-conditional]
What is the link to your site?
hidden link
Any help again is appreciated.
Thanks
Bryan
Dear Bryan,
How do you setup the repeatable fields "Sponsors", "Cast" and "Crew"?
Are they custom custom repeating fields or repeatable field groups?
If they are repeatable field groups, I suggest you follow our document to create a post view:
- query "Sponsors" posts
- filter by the relationship "Sponsors"
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups
- in section "Loop Editor", within shortcode [wpv-items-found] ... [/wpv-items-found]
Display the h4 title: <h4>SPONSORS</h4>
More help:
hidden link
And you can share your website credentials in below private message box.
Thanks for the details, for example the "Show Sponsors" repeatable field groups, you can move the HTML div wrapper into the child view "sponsors-4-column", I have setup a demo in your website:
1) Edit the content template: Individual Show Page
hidden link
Change the codes from:
<div class="sponsors wrap">
<h3>Sponsors</h3>
<div class="sponsor">
[wpv-view name="sponsors-4-column"]
</div>
</div>
To:
[wpv-view name="sponsors-4-column"]
2) Edit the post view "sponsors-4-column", in section "Loop Editor", change the codes from:
...
<!-- wpv-loop-start -->
...
<!-- wpv-loop-end -->
...
To:
...
<div class="sponsors wrap">
<h3>Sponsors</h3>
<div class="sponsor">
<!-- wpv-loop-start -->
...
<!-- wpv-loop-end -->
</div>
</div>
...
If you don't want to display anything when there isn't child item in "Show Sponsors" repeatable field group, you can remove those codes:
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
Save as above, you can move the HTML div tags into other child post view for Cast and Crew.
For your reference.