Is there a way to have a banner not appear every time a user revisits the page in Webflow without affecting the editor's functionality?

Published on
September 22, 2023

Yes, there is a way to have a banner not appear every time a user revisits the page in Webflow without affecting the editor's functionality. Here's how you can achieve this:

  1. Create a new collection: Go to the Collections tab in the Webflow Designer and create a new collection to store the data for the banner.

  2. Add fields: In the collection settings, add fields for the content of the banner, such as title, text, and any other relevant information.

  3. Design the banner: In the Webflow Designer, design the banner element using the layout and styling options available. You can use the collection fields to dynamically populate the content of the banner.

  4. Wrap the banner in a condition: Wrap the banner element in a conditional visibility setting using custom code. You can use JavaScript or plain CSS to achieve this.

  • JavaScript: Add a custom code embed before the closing </body> tag and use JavaScript to check if a cookie has been set. If the cookie exists, hide the banner. If the cookie does not exist, show the banner and set the cookie.

    ```javascript

    ```

  • CSS: Add a custom code embed before the closing </head> tag and use CSS to hide the banner based on the presence of a specific class or ID that you add to the body element when the banner is shown. You can add the class or ID using JavaScript.

    ```html

    ```

  1. Publish the site: Once you have implemented the above steps, publish your site to make the changes live. The banner will now only appear on the first visit to the page and not on subsequent visits.

By using this method, you can customize when and how often the banner appears to users without affecting the functionality of the Webflow Editor. The banner will only appear once per user, as long as they have cookies enabled in their browser.

Additional Questions:

  • How can I create a banner that doesn't appear every time a user revisits the page in Webflow?
  • What is the process for hiding a banner on subsequent visits in Webflow?
  • Is there a way to show a banner only once to each user in Webflow?