Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Katlynn 18 posts 89 karma points
    Jun 13, 2016 @ 20:39
    Katlynn
    0

    Show popup upon visiting site

    Hi all! So, I'm currently tasked with designing a marketing popup with a message for new visitors for the site I run, and I'm not sure where to start in Umbraco.

    I've done this before, but never in Umbraco and, of course, the method I usually use didn't pan out well.

    Basically, I need a fading popup to appear when users first visit the front end of our website that they can click to close. If someone could point me in the right direction of a tutorial or something similar, that would be great!

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Jun 14, 2016 @ 11:10
    Alex Skrypnyk
    0

    Hi Katlynn,

    Just use cookies or localStorage for storing some flag 'userVisitAlready' for example. In js code which is showing popup just check this flag.

    Thanks,

    Alex

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jun 14, 2016 @ 13:31
    Dennis Aaen
    0

    Hi Kytlynn,

    I think that you should have a look at this light weight plugin to read and write a cookie https://plugins.jquery.com/cookie/

    An example could be something like this.

     if (!$j.cookie("acceptCookies") || $j.cookie("acceptCookies") === "false") {
            $j('#cookieWarning').show();
            $j('#acceptCookies').click(function () {
                $j.cookie('acceptCookies', true, { expires: 365, path: '/' });
                $j('#cookieWarning').hide();
                return false;
            });
        }
    

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft