Display Pattern: Show Red Text for 1st Permission Set
Summary
Show red text “Public” if the first permission set is “Public”. Please keep in mind that you do not know if Public is assigned as first or 2nd permission set. This example shows the usage of arrays in Display Pattern.
{% if contentPermissionSetIds[0] == "e2d0dfd6b07546aeafeaf5a48946c7cf" %}
<font color="#ff5576">Public</font>
{% endif %}
Use Case
Virtual Items shall have a red text "Public" when the first permission set applied is "Public"
Open Virtual Type > Press Kit
Update the Detail Display Pattern
Get ID of the permission set from the URL
Check for ID and add text with CSS font color red.
JSON{% if contentPermissionSetIds[0] == "e2d0dfd6b07546aeafeaf5a48946c7cf" %} <font color="#ff5576">Public</font> {% endif %}
Limitation
The contentPermissionSetIds are arrays so you have to provide the position in the array e.g. [0] for the first position.
This solution only works if the permission set "public" is applied as the first permission set, which you cannot assure in all cases.