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 %}
JSON

Use Case

Virtual Items shall have a red text "Public" when the first permission set applied is "Public"

  1. Open Virtual Type > Press Kit

  2. Update the Detail Display Pattern

  3. Get ID of the permission set from the URL

  4. Check for ID and add text with CSS font color red. 

    {% if contentPermissionSetIds[0] == "e2d0dfd6b07546aeafeaf5a48946c7cf" %}
        <font color="#ff5576">Public</font>
    {% endif %}
    JSON

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.