Gå till huvudinnehåll

Using usergroups to hide and display different components in the Help Center - Kunskapsbas / Using Deskpro / Admin / CRM - Deskpro Support

Using usergroups to hide and display different components in the Help Center

Författarlista

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 a “Create Emergency Ticket” button.

  • You need to hide sensitive content from the Help Center 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 like 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 some advanced things, such as if/or/and operators, as well as nested arguments. We use the Twig template engine, so look here 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, or even their favorite food can be used to change their experience with the helpdesk.

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

Hjälpfull Oanvändbar

Posta en kommentar

Logga in eller registrera dig för att lämna en kommentar.

Behöver du en påminnelse om ditt lösenord?