Keep your users in the loop with a maintenance message

This really helps your app look professional and a benefit for the people using the app. This appears everywhere in your app and you can change the text in the JS and the color in the css

Javascript

var newDiv = document.createElement("div");
newDiv.id = "appUsersMessage";
newDiv.textContent = "Site Maintanance Planned on the 12/05/2023 at 3:00am - 6:00am";
var bodyElement = document.getElementsByTagName("body")[0];
bodyElement.insertBefore(newDiv, bodyElement.firstChild);

CSS

#appUsersMessage {
    text-align: center;
    background: rgb(209, 119, 23);
    color:black;
}
6 Likes

Thanks @Johnny_Appknowledged_UK - very useful snippet :+1:

2 Likes

This is great! I think this is a superb feature request, too, for built-in functionality. I will take it forward to Kara

2 Likes

@Ally I think this is a great idea perhaps if knack yourselves are doing maintenance we could have a option to allow for knack to update our users on performance updates with this type of messages. It might also help save time on responding to tickets your end.

I was thinking the feature could also have set messages for set times.

4 Likes

Just found the below message, I had obviously forgotten to send this reply:
Good thinking! I have logged the feature request, and linked to this forum so when it is being looked at, I am sure this thread will be opened up for questions and comments.

Hey everyone, I hope you’ve been enjoying these code snippets. I wanted to let you know that all of my code is now available on my new platform, Appknowledged. Appknowledged has taken over from KnackMods. I encourage all of you to sign up—it’s completely free—and you’ll have access to all of my free content.

1 Like

Excellent snippet Johnny, thanks a lot!