Hiding a Form From All Users Except Member of an Organization
We need to hide one form in the Help Center from all of our Zendesk users, except for the members of one organization.
I've found articles on hiding a form from everyone in an organization (https://support.zendesk.com/hc/en-us/articles/4408886229146-How-can-I-hide-ticket-forms-based-on-a-user-s-organization-) and hiding a form from the drop-down menu in the Help Center (https://support.zendesk.com/hc/en-us/community/posts/4411892827674-How-to-hide-dropdown-field-value-in-the-request-form-for-End-User-).
But I can't seem to get the pieces to fit together. Anyone know how we would do this?
-
Have you inserted the script in your document.head ?
also
-
Thanks I will give this a try later today
-
Hi I'm confused. This isn't working for me either and mtrl.bike's explanation is not clear for me. Where do we put Kay's code?
I used Ruddy DEROSIERS code. This is what I have now. Can someone help?? :(
This is the current version I'm on.
For each section (in BOLD) I put the following:
SCRIPT.JS section
//Hide Form
var i = 0;
var checkExist = setInterval(function() {
i++;
if ($("a.nesty-input").length){
clearInterval(checkExist);
$("a.nesty-input").each(function() {
$(this).bind( "click", function() {
for (var c in HelpCenter.user.organizations) {
if (HelpCenter.user.organizations[c].name ==="Main Company"){
$("#7286425102107").show();
}else {
$("#7286425102107").hide();
}
//reserve space for additional organizations
}
});
});
}
if (i > 10){
clearInterval(checkExist);
}
}, 100);DOCUMENT_HEAD.HBS Section
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
STYLE.CSS section
@keyframs animSlideTop {
0% { -webkit-transform:translate3d(0,-100%,0); transform: translate3d(0,-100%,0); }
100% { -webkit-transform:translate3d(0,0,0); transform: translate3d(0,0,0); }
#7286425102107{
display: none;Is @keyframes supposed to be in the Style.css? I tried it both ways, with and without. Either way the form still shows for people outside of the organization "Main Company".
-
So I've implemented this and it works great for signed-in users. With that said, if the user is not signed in - the form isn't hidden. Any answers on how I can prevent anonymous users from seeing the particular form too?
-
We just don't allow user that are not signed in to submit tickets. Do you need users that are not logged in to be able to submit tickets?
-
I never told you to do anything. I told you what we are doing, and I asked if there was a reason that you needed anonymous users to submit a ticket.
So, I'm not really sure what you mean by "You're incorrect...". There isn't anything to be correct or incorrect about in my reply.
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
36 Kommentare