Jump to content
TNG Community
Philip Roy

Bootstrap alert functionality

Recommended Posts

Philip Roy

Having run a commercial site in the past, I like to give users a heads up if there's server performances issue or if I plan maintenance...just out of courtesy. I try to avoid sending emails out to this effect, so I have come up with some code I am going to use in my index.php file of the template I use whenever I need to....

Quote

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">  
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>  
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>  

<div class="alert alert-warning alert-dismissible fade show" role="alert">
  <strong>Site Maintenance Planned</strong> - The site will be offline on XXXX for XXXX minutes whilst I update the software running the site. Apologies for any inconvenience this may cause.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

So they'll see this and be able to dismiss it when they come to the home page.

I think it would be great to put this in as a part of TNG itself...I could find myself using it for a lot of other things, like announcing more images etc...just to add a bit of excitement?

I'm suggesting an alert that can remain on for a number of days, when you choose to use it, and before you put the site into maintenance mode.

Phil

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×