Skip to main content

Using usergroups to hide and display different components in the helpcenter - Knowledgebase / Developer & Reporting / Portal Customization - Deskpro Support

Using usergroups to hide and display different components in the helpcenter

Authors list

Skill Level: Medium - Advanced (Requires very basic HTML/code editing skill, mostly copy and paste)

Read time: 8 Minutes

Use Case:

  • You want to offer a different overall feel/design for your premium users, or executive employees. Such as an “Create Emergency Ticket” button.

  • You need hide sensitive content from the helpcenter which only certain departments should see. Such as a link to the HR/Payroll system.

Instructions:

  1. You will need to determine the ID of the usergroups you want to limit, Navigate to Admin > CRM > Usergroups, and observe the ID on the left.

  2. Write a simple syntax like below,

{% if 10 in app.user.getUsergroupIds() %}
<p> Welcome Premium User Portal <p>
{% endif %)

Replace “1” with your ideal usergroup ID

  1. Navigate to the Admin > Help Center Design > Template Editor - then select any template for your choosing. Paste the code wherever you would liek this element to appear.

  2. Save, and apply all changes. (if there are problems, reset the template to default, and save)

Advanced reading...

You are able to do do some advanced things, such as if/or/and operators, as well as nested arguments. We use the twig template engine, so look her for full guidance: https://twig.symfony.com/doc/3.x/tags/if.html

For example,

{% if 10 in app.user.getUsergroupIds() and 20 in app.user.getUsergroupIds() %}
    <p>It must be nice to have two permission sets!</p>
{% endif %}

The possibilities are endless here, and not just limited to user groups, any other attribute of a user, such as their location, job title, even their favourite food can be used to change their experience with the helpdesk.

We offer premium consultancy for large customization projects if that is of interested.

Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Ar reikia priminti slaptažodį?