Skip to main content
Skip table of contents

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.

JSON
{% 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"

  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. 

    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. 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.