Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dugjason/49229ff771412481d59e to your computer and use it in GitHub Desktop.
Save dugjason/49229ff771412481d59e to your computer and use it in GitHub Desktop.
Showing additional content to a user in Zendesk's Help Center. Here I am showing a Zendesk user's support SLA as they submit a new request in the Help Center, based on the GROUP they belong to within Zendesk.
Zendesk Help Center show additional content to user
/* Hide SLAs with .hidden class
*
*/
.hidden {
display: none;
}
/*
* jQuery v1.9.1 included
*/
$(document).ready(function() {
// show support SLA dependent on subscription level
(function() {
var supportGroup;
//get users group from the HelpCenter object
supportGroup = HelpCenter.user.groups[0].name;
switch(supportGroup) {
case "Elite" || "Elite VIP":
$('#support-sla-elite').show();
case "Premium":
$('#support-sla-premium').show();
case "Standard":
$('#support-sla-standard').show();
default: //Community support
$('#support-sla-community').show();
}
}());
});
<nav class="sub-nav clearfix">
{{breadcrumbs}}
{{search_bar_small}}
</nav>
<div class="clearfix">
<section class="main-column">
<h1>{{header}}{{follow_up_hint}}</h1>
{{error_list}}
<div class="form">
<div class="support-slas">
<div><strong>Initial Response SLA:</strong>
<span id="support-sla-elite" class="hidden">4 hours</span>
<span id="support-sla-premium" class="hidden">8 hours</span>
<span id="support-sla-standard" class="hidden">1 business day</span>
<span id="support-sla-community" class="hidden">3 business days</span>
</div>
</div>
{{form}}
</div>
</section>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment