Last active
December 23, 2015 23:29
-
-
Save skipjac/6709976 to your computer and use it in GitHub Desktop.
Show and hide the "My activities" and "Submit a request" in Zendesk HelpCenter based on Organization tags. Place the code from the hideElements.css in the CSS tab of the theme page. And place the code from showElements.js in the JS tab right after the line ```
$(document).ready(function() {
```
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ==================================================== | |
things to hide at start up | |
==================================================== */ | |
a[href$='requests/new'], .my-activities, #user-menu .my-activities { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var isCust; | |
function isCustomer(element, index, array){ | |
return (element === 'paying'); | |
} | |
HelpCenter.user.organizations.forEach(function(x){ | |
isCust = x.tags.some(isCustomer); | |
return (isCust === true); | |
}); | |
if(isCust === true){ | |
$('a[href$="requests/new"]').show(); | |
$('.my-activities').show(); | |
$('#user-menu .my-activitis').show(); | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment