Streaming live at 10am (PST)

Alert Box for CMS


#1

Hi, all! I have a problem I'm trying to navigate. I work for a non-profit and one of the services we provide is websites for schools. I'm pretty happy with how our sites have turned out. You can see a few examples here:

http://bristow.k12.ok.us/

http://chickasha-website.webflow.io/

One of the requests I have from schools is to add an alert box at the top of a site so that schools can post during emergency situations. School closings, weather alerts, etc.

I know I can do this with some custom code and the CMS. If I use the : empty selector I can make it to where the bar doesn't show when they go in and erase the text and publish. This will work, but it seems a bit convoluted.

Anyone have any ideas?


#2

OOOOOO! I know i know! raises hands

I did this exact thing on https://irteams.org. Give me a sec to write it up


#3

Ahhh, yes!!! I love this forum! I'm glad you're here, @PixelGeek!! You're so helpful! I greatly appreciate it!


#4

enjoy! :smiley:


#5

Nelson,

That. Is. Brilliant!! Thank you so much! Could you share the read-only link so I can explore the ins and outs on some of your settings?

This is going to solve the issue for me!


#6

http://preview.webflow.com/preview/irt?preview=50eb8734225dc54a1756b2adc2bb601f


#7

You rule! Last question....will you paste your cookie code as well? I want to crawl through it! If not, no worries!


#8
<script>
$.getScript('https://cdn.rawgit.com/js-cookie/js-cookie/master/src/js.cookie.js', function() {
  var cookieName = 'isModalClosed';
  var cookieDate = $('#cookieDate').text();
  if(typeof Cookies.get(cookieName) !== 'undefined') $('.emergency-modal').remove();
  $('#closeModal').click(function() {
    Cookies.set(cookieName, cookieDate, { expires: 1 });
  });
});
</script>

#9

Thank you! I appreciate all the time and help!


#10

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.