I am creating a website in Webflow, which has multiple collection lists on a static page, so I designed a static page wich displays all kind of those lists: https://stimo.webflow.io/aktualnosci
It contains: aktualnosci, projekty and praca collection lists.
My client asked me to create a conditional visibility for a praca collection list. They want to hide this whole section, when there is no published praca item.
Of course i’ve got through this article earlier. The problem is that there is no “conditional visibility” fields on item I want to hide, when collection is empty…
Please include your site’s Read-Only Share Link with your question.
A read-only link allows the community to view your project without making any edits to it and help diagnose your issue or provide feedback.
If your project has custom code or layout issues on the published site, please share that URL/URI as well.
To conditionally act on an element outside of the collection list you would need to use custom code. I would add an ID to the collection list wrapper and use that as the target to get the length of the array. If zero then hide the wrapper you wish to target (best to use an ID on that element as well. Here is an example using jQuery that needs to be modified for your use case and elements.
// Code block in before body close in page settings
<script>
if (!$('#collection-list-id-to-target').length){
$('#wrapper-id-to-hide').hide();
}
</script>