Streaming live at 10am (PST)

Conditional visibility not working on slide

I followed the instructions from this other post and it worked!

Thanks for the heads up. It’s a clever trick but webflow doesn’t allow more than 20 collection list items on one page. For me it would mean close to 50 list items :frowning:

I’m having a new issue on this.
I have a 10 photos slideshow but only 5 of them are displayed using the conditions mentioned above.
https://preview.webflow.com/preview/asmana?preview=ab355501c284a29a3cce6a5ea014fe9a

I could find out the reason for this.
Can anyone help me?

I am also having the same problem. I place a CMS collection inside the slide and set the slide background with CMS image. The each slide I tried to set with the conditional visibility if the CMS image is set. However it always has an extra blank slide.

Here is my website link for the slider problem:

Hello.
Maybe this plugin can help you

I don’t know if any of you all are still looking for a solution but here it is.

The task: To force Webflow to actually remove the Slide after it has been made conditionally invisible.
The problem: Webflow is hiding the CMS content for the Slide but not the Slide architecture itself, thus the blank ghost slide.
The solution: Push a .remove() command directly to the Webflow js for whenever the conditional visibility is set to be hidden.

Why this is the best solution: No new collections, no complicated site architecture changes, just plug the following code right into the “Before Body Tag” section of your page and publish.

Super easy, and quick, even if you have a ton of collection items.

Hope this helps someone! :slight_smile:

    <script>
Webflow.push(function() {
  $(".w-condition-invisible").remove();
});
Webflow.ready();

</script>
6 Likes

You are the man! @studiopowell :muscle::muscle::muscle::muscle::muscle:

Happy to help @Pablo_Ledo!

This doesn’t seem to be working on a CMS collection page, any idea why not?

@Christian_Skelton I have it implemented on a CMS collection page to good effect. Can you describe the issue and/or your code placement in greater detail?

I’ve added your code to the ‘Before tag’ section of the template, but on some CMS items it still shows the blank slide, e.g https://www.sussexhuts.com/story/the-guest-bedroom

can you share your preview link?

Did you make sure to set your visibility conditions on the slide content in question?

Yes I’ve set conditional logic, and the document flow is:

Slide 1

  • Image

Slide 2

  • Image

And so on. Could it be because I’m adding an image block to each slide instead of a background image?

Also, weirdly some of them work and some don’t. The example in my previous comment shows a rogue grey background.

Setting the visibility condition on the slide, and adding an image is the right structure.

However, if some of the slides are working and others are not, that is a solid clue that the issue may not be with the remove command, but with something else interfering on specific slides - giving us a preview link would help.

:slight_smile:

Hey, did you get the preview link? Any ideas?

THANK YOU SO MUCH for this solution, you saved me from having to make extra slides to fill in the blank ones or trying another solution like a lightbox or someting else.
For those of you that tried studiopowell’s script and said it didn’t work for them,.please keep in mind that the script will not work in preview mode…you have to publish your site to see the results.

I had the same Problem and just stumpled upon this. Is there any reason this woudn’t work anymore?
I just tried but I cannot get rid of the Ghost slide.

Did they change anything in the Code so it has to be adjusted?

2 Likes

Bumping this thread, as I’ve the exact same issue as @0nul

@studiopowell 's solution seems brilliant, however I’m not able to get it to work. Is this solution out of date? I’ve yet to find any other workaround that makes any sense.

Hello !

@studiopowell is your code still working on your project?
I tried your code, but It doesn’t remove the blank slide.

like @Onuj, @cmiller said, It seems the code is not working anymore. Could you confirm?

Is there another solution to get rid of this blank pic where condition visibility is normally “not set”.
when Webflow will cover this bug.

thank you

@sprea , I actually wound up finding a solution that works in this thread, hopefully it can help you as well: https://discourse.webflow.com/t/solution-cms-gallery-slider-showing-1-blank-slide/135844/3

1 Like