I would like to display the contents of a Container only if the View that is one of the elements in that Container is not empty. Is there a way to set up a Conditional to accomplish that?
Hi Anthony,
Thank you for contacting us and I'd be happy to assist.
To suggest the best way to achieve this, I'll need to see exactly how this container and view is set up in the admin area.
Can you please share temporary admin login details along with the link to a page with this container?
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
Hi,
Thank you for sharing further details.
For what you're planning, you can use the following steps:
1. In the "Additional CSS Class(es)" field for the "Accordion Item" block that you'd like to target, you can include a custom CSS class, for example, "featuring-container".
( screenshot: hidden link )
2. The next step would be to include some custom CSS code to hide this accordion-item container, but only when that view returns no results.
For this, you can place that CSS code inside that view's "[wpv-no-items-found]... [/wpv-no-items-found]" tags.
( screenshot: hidden link )
<style type="text/css">
.featuring-container.wp-block-pb-accordion-item {
display: none;
}
</style>
As a result, this CSS code will only be included in the output, when the view will have no results and the enclosed container will be hidden.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
This totally resolves this issue - thank you very much!