Recent searches
No recent searches
Adding a notification banner to your Help Center v2
Posted Feb 08, 2016
Plan Requirement: Pro Plan and up (if on lower plan see this version)
Zendesk level: Intermediate
Knowledge: HTML, CSS, JS, API
Time Required: 15 minutes
Have you ever wanted an easy way to notify your end users of System Outages, Important Announcements, or Releases. If so, then the Notification Banner v2 is exaclty what you are looking for. In my previous versions we had to add a word like "Issue" in the title of your article in order for the notification to show. With the new version we are going to leverage the Zendesk API and use Article labels to display our alerts.
In order to shorten this article, you can find all the code and instructions on my GitHub Page.
Screenshot
---
This post has been edited by the Zendesk Community Team to remove a "Live Demo" link that no longer works.
4
293 comments
Russur
Hi Wes,
I have copied everything to the correct place, as per your instructions, but nothing is displaying.
I double checked the url that is accesed in the .js file, and that url does indeed get the correct article. But nothing is showing. Any ideas?
Thanks,
Russ
0
ModeratorWes
Russ,
Can you provide a link to your Help Center and which solution are you trying to implement. Are you on Pro Plan or higher.
0
Russur
Hi Wes,
Here is the link to our Help Center.
https://support.brainspace.com/hc/en-us
We have an Enterprise plan, and i was trying to use the solution you detailed in your github site.
Thanks,
Russ
0
ModeratorWes
@Russ - Your page is behind a sign-in so I can see it to take a look at the code. Did you add the label to the article and also did you make sure it wan't in a locked down section.
Also make sure your JS is below the $(document.ready) function and you change the first line to your subdomain
0
Russur
Sorry about that. Here is the article, in edit mode, and you can see the alert setting.
Here is a screen cap of my Header page.
I put your .css source at the bottom of the css file.
I put the .js, at the bottom of my .js file, here is the screen cap of that:
The article that has the alert setting, is just another article, but you have to be a logged in user to access them. Even so, shouldn't I be able to see them?
Thanks for your help!
Russ
0
Russur
Let me change the .js, and see if that works.
0
Russur
I just moved that, to after the location you mentioned, but didn't seem to make any change.
0
ModeratorWes
@Russ - Everything looks correct but I would have to see your site in order to troubleshoot further. Copy and paste this in your browser and let me know if you are returning the article.
https://brainspace.zendesk.com/api/v2/help_center/articles.json?label_names=alert
0
Russur
Hi Wes,
I had tried this earlier, and got the same resutl. I tried it with your link ,and again got the article i expected:
0
ModeratorWes
Do you have any other customization that my be interfering with the script. What theme are you currently using.
0
Russur
We are using a customized theme. Would it help if i sent you the .css for that, or any of the other files?
0
ModeratorWes
Not really I would have to inspect your home page with the dev tools to make sure the alert is showing and see if anything is overlapping it.
0
ModeratorWes
You can create me a temp end user account, you can use support@wesdrury.zendesk.com so I can log in as a end user.
0
Russur
fwiw, I did a screen cap from dev tools, when i had selected teh alertbox div. It appears that its size is inheriting from somewhere else?
0
ModeratorWes
The alertbox won't inherit until there is data in there as the JS will insert it the data. I see you have two console errors what are they?
0
Russur
Here is a screen cap of that:
0
ModeratorWes
K there is our issue I believe.
Lets change your domain to support.brainspace.com/api/v2.... and if that doesn't work let change to /api/v2.... remove all the https.
Also do you have a SSL certificate or anything installed.
0
Russur
Hi Wes,
Changing the Domain Name, seemed to do the trick! Looks great! Thanks for your help!
Russ
0
ModeratorWes
@Russ - Glad to hear the domain name did the trick. Best of luck!
0
Russur
Hi Wes,
One other question, is there a way to click and toggle that Notification box off and on?
Thanks,
Russ
0
ModeratorWes
@Russ - If you look at the Live Demo then you will see a white X in the top right corner that users can click on to close however it would come back if they navigate to another page. Since you have a custom theme you may need to adjust where the X is showing via CSS.
0
Luke Barrett
Hi Wes
This looks like a great feature which we'd get a oot of use out of. Sadly I'm having difficiulty getting it to work. I'm trying it in our Sandbox. Will this make a difference?
*****************************************
Screenshots of how I've copied the HTML and JS are below. I've created an article labelled with alert too.
Any advice would be much appreciated.
Thanks - Luke
Edit: removing certain data from post.
0
ModeratorWes
@Luke - I just installed it on my Sandbox without any issues so it should work. From your screenshot the domain name has too many slashes so make sure your domain name is correct, it should be:
"https://transversal1442412232.zendesk.com//api/v2/help_center/articles.json?label_names=alert"
You can also try:
"/api/v2/help_center/articles.json?label_names=alert"
0
Luke Barrett
Wes - you're a star - thank you so much for the quick and helpful response.
I changed it to "/api/v2/help_center/articles.json?label_names=alert" and it's worked a treat. Very exciting!
0
ModeratorWes
@Luke - Glad to hear it worked, you can now move that code straight over to production without changing a thing. If you run into any other issues just let me know.
0
Permanently deleted user
Have we been able to find a solution, for Help Centers in muliple language to display an alert message localazied in the language and/or not display the alert if the article is not translated in that language?
0
Hugo Villalobos
Hello guys, I have the banner like this:
Is there any way I can modify the code to have the title in the middle and centered?
Thank you.
0
Marissa Frizzell
Thanks for this, worked like a charm!
0
ModeratorWes
@Marissa - Glad to hear. Best of luck
0
Edmund Eng
Hi Wes,
Great work on this notification banner and your very clear instructions. It's exactly what I was looking for!
Need some assistance though. I added the notification code to my Help Center Professional Plan, and notifications doesn't seem to be working. The notification banner does not appear after creating an article with the tag "bigalert" (I changed the label)
$.get( "https://helpcentral.zendesk.com/api/v2/help_center/articles.json?label_names=bigalert" ).done(function( data ) {
I'm currently in the process of preparing for the migration from Web Portal to Help Center (I know, I'm late to the party).
Is the notification banner not appearing because my Help Center instance is still in "Setup Mode"?
0