How to Webflow: Adding cookies to custom modals - Tutorial (2019)

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 78

  • @legosnell
    @legosnell 4 года назад +3

    Thank you so much for breaking down the Javascript! I have almost zero working knowledge of Javascript, and this was so incredibly helpful. You've done a great job of explaining the "why" for the different parts, which isn't something I'm used to seeing. Thank you for that!

    • @pixelgeek
      @pixelgeek  4 года назад

      my pleasure. glad this video helped you 😁

  • @virathedon
    @virathedon 4 года назад +4

    You, sir - are a good man! You make everything look so simple.

  • @michaelcoussement5392
    @michaelcoussement5392 3 года назад +1

    Very helpful and clear breakdown! It worked instantly on my site! Thanks

  • @daleldalel
    @daleldalel 4 года назад +2

    Thank you !!! I had a problem because my close button was a combo class, so for anyone using combo classes, you are better off just duplicating the original class and changing it accordingly.

  • @vla.design
    @vla.design 2 года назад

    Finally it works! Thanks man! All clear with the explanation. Keep rocking

  • @jaimealbertoortizlozano5708
    @jaimealbertoortizlozano5708 3 года назад +2

    Hi the page where the code is to be copied has been deleted :S. Can you tell me where can I get the code from? Thank you

  • @paul-minotto
    @paul-minotto 4 года назад

    Thanks for filling in the gaps often left out in videos.

    • @pixelgeek
      @pixelgeek  4 года назад

      My pleasure 😁👍♥️

  • @andrew-pro85
    @andrew-pro85 3 года назад +1

    Thanks Nelson, cool lesson! Where is can find JS code? By the link in the description for full code opens 404 page.(

  • @jonasernevi6586
    @jonasernevi6586 3 года назад +1

    Thanks for this, much helpful. I am having problems adding multiple cookies/modals that will remain closed. Could you please explain how you would do this? Thanks

  • @delfs413
    @delfs413 3 года назад +1

    Thnk you Nelson! Big help!

  • @matteolarice9656
    @matteolarice9656 4 года назад +1

    Thanks Nelson! Very useful tutorial as usual. Can the code be used to generate 2 separate cookies? For example one for the "cookie-notice" and one for the "newsletter-modal". Can you show us an example of what the code would look like?

  • @vaniarensi2326
    @vaniarensi2326 4 года назад +1

    Super useful and clear, as usual 🙏🏻

    • @pixelgeek
      @pixelgeek  4 года назад +1

      Glad it helped 😁🙇🏽‍♂️ did you join the community yet? pixelgeek.community

    • @vaniarensi2326
      @vaniarensi2326 4 года назад

      @@pixelgeek Yesssss

  • @CyanCooper
    @CyanCooper 4 года назад

    Thank you for making this video Nelson! For anyone who is curious: you can put this into the whole site's code and have your modal on every page (like a cookie notification), so no matter which page a user lands on, they'll see the modal until they click to dismiss it. Once they click to dismiss it, it won't appear on any pages going forward.

    • @nicoeiben4272
      @nicoeiben4272 4 года назад

      can you explain this tom me more detailed. It doesn't work on my site. Seems like I have to close the cookie notice on every page and then it does not show up

  • @juliaguimbaud
    @juliaguimbaud 3 года назад +1

    Thank you very much, your videos are very helpful ;)

  • @MyDistortedWorld
    @MyDistortedWorld 5 лет назад +1

    Hey dude! Another very useful tutorial, thanks!

    • @pixelgeek
      @pixelgeek  5 лет назад

      you're welcome :) thanks for watching.

  • @yehonatangoldman8110
    @yehonatangoldman8110 2 года назад +2

    Hey, great tutorial! can you please post a link to the code again? seems to be broken...

    • @susisuuu9
      @susisuuu9 2 года назад +1

      Here it is :)
      var cookieName = 'modalClosed';
      if(typeof Cookies.get(cookieName) !== 'undefined') {
      $('.modal').remove();
      }
      $('.close-modal-bg, .close-modal').on('click', function(){
      Cookies.set(cookieName, 'ok', { expires: 7 });
      })

  • @asagoldstein1669
    @asagoldstein1669 4 года назад +1

    For some reason this doesn't work if there are multiple triggers for the modal on one page. Only works once you move to another page. How to fix this?

  • @oleww50
    @oleww50 5 лет назад +1

    Hi Nelson, thanks for the video! Most appreciated :-) I look forward to implementing this 👍

    • @pixelgeek
      @pixelgeek  5 лет назад +1

      can't wait to see what you do with this tip :)

  • @puzzlefactorysoundstudios
    @puzzlefactorysoundstudios 4 года назад +1

    Thanks so much, Nelson!

    • @pixelgeek
      @pixelgeek  4 года назад

      my pleasure :) Thanks for watching.

  • @goldenant9450
    @goldenant9450 10 месяцев назад

    doesn't seem to work. "Cookies.set" shows in different colors. Blue for Cookies, White for the period, and green for set. I don't know much about code but i'm pretty sure that means the term Cookies.set is not being recognize as intended.

  • @benio.u
    @benio.u 3 года назад

    Hey dude! This is amazing, thank you for creating the video. I'm having an issue though... I followed your steps perfectly and the pop up still shows up. I have set it to animate in (appear) after 61 seconds. Could a webflow-created animation be conflicting with the script?

  • @grantsenior3291
    @grantsenior3291 4 года назад +1

    Thanks Nelson, this was very useful for me today, and saved me a lot of time ;-)

  • @Maximforall
    @Maximforall 4 года назад +2

    It somehow doesn't work for me. The modal closes but no cookie seems to be set.

    • @SophieJeanPaul
      @SophieJeanPaul 4 года назад

      It's not working for me too

    • @SophieJeanPaul
      @SophieJeanPaul 4 года назад +2

      Hey I find why it's not working for me. All classnames in the code should be lowercase even if You use capital letters in Webflow.
      forum.webflow.com/t/here-is-how-to-add-cookies-to-a-custom-modal/98956
      Pixel Geek explained it here in the comments.

  • @grantsenior3291
    @grantsenior3291 4 года назад

    Hi Nelson. Have you experienced any issues with this not working in IE 11? I've used this on a few sites just recently and all of them fail to operate in IE11.

  • @dariostefanutto5780
    @dariostefanutto5780 4 года назад +1

    The question is, do I need to add this by law? How does Webflow manage cookies? I'm ignorant about this and it's not clear to me.

  • @tiborgludovatz2666
    @tiborgludovatz2666 3 года назад

    Great Video! Can you extend this tutorial to show how to create an EXIT INTENT Popup Modal?

  • @rohanganachari7612
    @rohanganachari7612 5 лет назад +1

    Hi, Nelson! This video was very helpful. Thanks! 👍 My suggestion for the next video is - How to use Tags in webflow? (the list of 10 tags in the Settings panel)

    • @pixelgeek
      @pixelgeek  5 лет назад +1

      good idea for a future video :) I'll make a note of it. Can you show me an example of what you're talking about?

    • @rohanganachari7612
      @rohanganachari7612 5 лет назад

      ​@@pixelgeek Hi! Apologies for the late reply. Well, you could take a few pre-built template pages such as Home, About, Product & Blog page, Contact, FAQ, etc. and explain - which Tag to assign to what element, and why? Since making websites accessible for humans & bots is so important, I think it would be great to have some guidance on this aspect as well. :)

  • @csirkosz
    @csirkosz 4 года назад +1

    Thanky thanky thank youuu thanks!

    • @pixelgeek
      @pixelgeek  4 года назад

      You're welcome! 😁

  • @thewebart
    @thewebart 5 лет назад +1

    Thank you Nelson!

    • @pixelgeek
      @pixelgeek  5 лет назад

      my pleasure :) Thanks for watching

  • @brandonmosco8365
    @brandonmosco8365 5 лет назад +1

    You mentioned briefly about a form submission. Could you update the code to reflect for this to turn off after a form has been submitted for the user? That way it doesn't keep popping up every 7 days or however many you have it set for?

    • @pixelgeek
      @pixelgeek  5 лет назад +1

      you could try adding the classname of your submit button in the same place you add it for the close buttons.

  • @bartspek
    @bartspek 5 лет назад

    Hi Nelson - Great video - Other question - Would it be possible to have webflow only create a desktop version. So on mobile, you would see a scaled version of the desktop one. Need this option for a client when we're still on Muse. (Or another way not to have to put in the hours in Responsive behavior of all our elements. I hope you have some great insights on this. Thanks in advance! And greetings from Holland!

    • @pixelgeek
      @pixelgeek  5 лет назад

      That is what you call "adaptive design". This isn't a good approach. Here is an article about this that may help you: uxplanet.org/adaptive-vs-responsive-web-design-eead0c2c28a8

  • @ericschenkenberger6118
    @ericschenkenberger6118 Год назад

    Does anyone know of a good update for this? Looks like Nelson removed the page where the code was originally hosted.

  • @raxitfaldu
    @raxitfaldu 3 года назад

    hi, this was very help full,
    but can you please help me understand,
    i would like to design a popup/a page that asks the website visitor to select a country as they enter the site for the first time, once they select the country i want the data to be saved in their browser and not ask again till they clear their browser data.

  • @IbnEYasin
    @IbnEYasin 3 года назад

    Thank you si much. Thank You so much

  • @maylee7140
    @maylee7140 3 года назад

    This worked perfectly fine but now it's not working anymore and I haven't touched it. Any idea how to fix this?

  • @ashleehayes707
    @ashleehayes707 4 года назад +1

    Does this work on a custom modal trigged on scroll? I can't get it to work and I'm wondering if that is the reason why.

    • @pixelgeek
      @pixelgeek  4 года назад

      can you reply back with your read-only link and i'll look into it?

    • @ashleehayes707
      @ashleehayes707 4 года назад

      @@pixelgeek
      preview.webflow.com/preview/red-white-boom?preview=297fe7f17da45e3681b045200d1992b0&mode=preview
      Thank you!

  • @anamarikilla
    @anamarikilla Год назад

    The link with the full code is not working 😢

  • @DraganMiletic
    @DraganMiletic 5 лет назад +1

    Mega thanks!

  • @lilimxprice
    @lilimxprice 4 года назад +1

    Thank you :)

    • @pixelgeek
      @pixelgeek  4 года назад +1

      My pleasure 😁🙇🏽‍♂️

  • @OwntoneFilm
    @OwntoneFilm 5 лет назад

    Great tutorial as always Nelson - digging all the Webflow content you all have been posting. For some strange reason after following this exactly (I think anyway ;) I can't get the modal to not keep appearing every time I reload the page. Any ideas for troubleshooting this kind of thing would be greatly appreciated...

    • @pixelgeek
      @pixelgeek  5 лет назад +1

      Thanks for watching 😁 can you reply with your read only link?

    • @OwntoneFilm
      @OwntoneFilm 5 лет назад

      @@pixelgeek Yeah sorry - the page in question right now is 'Modal' preview.webflow.com/preview/crispina?preview=2ae293eda6b192c2ca68123fdaeec430&mode=preview

  • @robert-janek
    @robert-janek 5 лет назад +1

    Thanks a bunch :)

    • @pixelgeek
      @pixelgeek  5 лет назад

      My pleasure 😁👍🙇🏽‍♂️

  • @olehansen6568
    @olehansen6568 5 лет назад +1

    Perfect 👍

  • @nathangarland7711
    @nathangarland7711 3 года назад

    How do you add different cookies on different divs to offset the expiry timing?

    • @pixelgeek
      @pixelgeek  3 года назад

      i think you could just duplicate the code and make sure each one has a different cookie name and targeted element.

  • @brandonmosco8365
    @brandonmosco8365 5 лет назад

    How to create an auto-populate copyright code for footer?

    • @pixelgeek
      @pixelgeek  5 лет назад

      can you give me an example of what you're talking about?

  • @baron5978
    @baron5978 3 года назад

    Script?

  • @brandonmosco8365
    @brandonmosco8365 5 лет назад

    Id like to see the copyright auto-detect what year it is without me having to go into dozens of sites and manually changing the © date. See image link: share.getcloudapp.com/X6u29g7A

    • @pixelgeek
      @pixelgeek  5 лет назад

      Hi Brandon!! :D This may help you: forum.jquery.com/topic/get-current-year

  • @miekthompson357
    @miekthompson357 2 года назад +1

    Full code link is 404 in description
    /video/how-to-webflow-adding-cookies-to-custom-modals