Adding Display Conditions for Content in a Custom Page

Display conditions allow you to tailor the display of content in your custom pages. You can apply conditional statements based on your Partner Groups to the content rows in a page, to show different content based on the recipient or viewer of the page. A row will only be displayed if the viewer meets the conditions. For example, you could limit access to pricing based on partner group membership, provide translated content for your partners in different countries, or only display sensitive data to a subset of your partner population.

Note: To restrict access to the whole page, not just to parts of its content, you can select a partner group as the Visibility setting for the page in the portal navigation. For more information, see Manage Visibility of Pages in a Partner Portal.

You have two options for display conditions:

  • Use a default display condition -  Unifyr One provides a display condition option for every one of your active Partner Groups. You can choose one and apply it to a content row.
  • Create a custom display condition - You can use HTML code and partner group IDs to create your own custom display condition for a content row. With this option, you can use a combination of Partner Groups to create the condition.

Apply a default display condition to a content row

  1. Navigate to Partner Portal > Custom Pages.
  2. Open the custom page you want to edit.
  3. In the WYSIWYG content editor area, click the row that you want to filter, to highlight it (outlined in blue). The Row Properties menu opens in the right-hand panel.
  4. In the Dynamic Content section, click Select condition.

    admin_custom_page_display_condition.png

  5. Select the required display condition from the drop down list. The list includes a display condition for each of your active Partner Groups.

    admin_custom_page_display_condition_select.pngg

    Once selected, the description of the condition displays in the Display condition field.

    admin_custom_page_display_condition_added.png

    For information on creating a display condition for users who AREN'T in a partner group, see Creating a display condition for users who are NOT in a Partner Group.

  6. To remove the display condition from the row, click Delete.
  7. Click Save at the top of the page to confirm the change.

Apply a custom display condition to a content row

  1. Display conditions are based on Partner Groups. You need the ID of each Partner Group that will form the display condition - to get it, open the partner group from Partner Management > Partner Groups and copy the ID from the end of the Unifyr One URL.  Paste each ID to a basic text editor such as Notepad.  

    For example - to get the ID of the partner group that represents French partners:

    admin_partner_group_get_ID.png

  2. Navigate to Partner Portal > Custom Pages.
  3. Open the custom page you want to edit.
  4. In the WYSIWYG content editor area, click the row that you want to filter, to highlight it (outlined in blue). The Row Properties menu opens in the right-hand panel.
  5. Scroll down to the Dynamic Content section and click Add condition.

    admin_custom_page_display_condition_create.png

  6. In Add a new display condition, complete this information:

    Filter Description 
    Name The name of the condition.
    Description A summary of the condition - for example, list the partner groups that make up the condition.
    Before

    Paste HTML code representing the condition into the field, replacing #### with the IDs of the partner groups that will form the condition.

    Note

    Ensure that you use straight quote marks, not curly ones.


    For a condition based on matching a single partner group:

    <span ng-if="partnerGroups.includes('####')">


    For a condition based on matching multiple partner groups (for example, one based on 2):

    • AND statement (all partner groups must apply):

      <span ng-if="partnerGroups.includes('####')&&partnerGroups.includes('####')">

      You add a &&partnerGroups.includes('####') entry to the if statement for each additional partner group after the first one.

      For example, this is the line of code for a display condition based on the Partner Group IDs 8a9982f18a2532f6018a286f03f40490 and 88b48a94f56b4c0c88054d93d7976eb1

      <span ng-if="partnerGroups.includes('8a9982f18a2532f6018a286f03f40490')&&partnerGroups.includes('88b48a94f56b4c0c88054d93d7976eb1')">

    • OR statement (at least one of the partner groups must apply):

      <span ng-if="partnerGroups.includes('####')||partnerGroups.includes('####')">

      You add a ||partnerGroups.includes('####') entry to the if statement for each additional partner group after the first one.


    For information on creating a display condition for users who AREN'T in a partner group, see Creating a display condition for users who are NOT in a Partner Group.

    After

    Paste this HTML code into the field:

    </span>

    admin_custom_page_display_condition_new2.png

  7. Click Confirm. The display condition is listed, with its description, in the Display condition field for the row.  It includes the label CUSTOM.

    admin_custom_page_display_condition_custom.png

  8. To remove the display condition from the field, click Delete.
  9. To review or update the syntax the condition, click Edit.
  10. Click Save at the top of the page to confirm the change.

Creating a display condition for users who are NOT in a Partner Group

The instructions in the sections above create display conditions that match users who are members of particular Partner Groups.

If you want to provide content for users who aren't in certain Partner Group or Groups, follow the instructions above to create the condition, then go to the Before HTML code and manually add a ! before each PartnerGroups snippet that should be an "is not a member of" statement.

admin_custom_page_display_condition_not_in_group.png

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.