Re: Hide/Show sections within a Web Page using Web Roles
Hi @AR19 ,
You can achieve this using some custom code. First of all web page that you want to show needs to be build using a custom liquid template. In liquid, you have special object called user which contains information about currently logged in user. It has property roles - which is an array of web roles assigned to the user. You can use special filter has_role to see if the user has a particular role and show section for specific users. For example:
{% comment %} Check if user has role 'Support User' and assign result to variable called supportUser {% endcomment %}
{% assign supportUser = user | has_role: 'Support User' %}
{% comment %} Check if user has role 'Regular User' and assign result to variable called regularUser {% endcomment %}
{% assign regularUser = user | has_role: 'Regular User' %}
{% comment %} check if supportUser and content for them {% endcomment %}
{% if supportUser%}
<div>Some HTML for SUPPORT USER</div>
{% endif %}
{% comment %} check if regularUSer and content for them {% endcomment %}
{% if regularUser%}
<div>Some HTML for REGULAR USER</div>
{% endif %}
You can find more about using liquid in the portal in this official docs.
Hope this will help.