Conditional visibility not working on slide

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>
8 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 The Guest Bedroom – Sussex Huts

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

2 Likes

@cmiller Thank You a lot, :pray: I didn’t see this post. It works perfectly !! :100:

Thanks for sharing this @cmiller that solution worked

Awesome! Thank you for posting this. Glad it’s still working 3 years later :slight_smile:

Works for me! Thanks!