cs-icon.svg

Audience Plugin Usage Guide

Audience plugin allows you to customize the target viewers of your JSON Rich Text Editor content.

Consider a scenario where you have to display different content on your university website for faculty and students. Creating multiple entries with additional content for various audiences can be time-consuming. In this case, the use of the Audience plugin can be convenient. Audience data can be added to a content type, and this value can be referred to in multiple content types to customize the audience who can view your content. This helps make your content audience-centric and can improve the reach of your content.

Prerequisites

This step-by-step guide explains how to set up and use the Audience plugin within your JSON Rich Text Editor in Contentstack.

Steps for Execution

The steps to set up and use the Audience plugin are as follows:

  1. Create a Content Type to Render your Audience
  2. Install and Configure the Audience Plugin
  3. Add the Audience Plugin within your JSON Rich Text Editor
  1. Create a Content Type to Render your Audience

    Let's create two content types called University and Institution for this use case. The University content type will contain the faculty and student information that can be referred within the JSON Rich Text Editor in multiple content types to customize the audience (faculty/students) who can view your content. The content type from which you render your audience content must match the following structure:

    image10.png

    Note: Your audience data content type must have a Title and a Group field set to type multiple containing a Title field with the UID as title.

    Create an entry for this content type as given below:

    Marketplace_Audience_Entry.png

    After you have created the content type with an entry from which you are rendering the target audience, let's install and configure the Audience plugin.

  2. Install and Configure the Audience Plugin

    Follow the steps below to install the application in Contentstack.

    1. Log in to your Contentstack account.
    2. In the left-hand side primary navigation, click the Marketplace icon to go to the Marketplace.
      Marketplace-Icon
    3. Click Apps from the left panel.
    4. Within the Marketplace, you can see all the available apps. Hover over the Audience app and click the Install App button.
    5. image7.png
    6. In the popup window, select the stack where you want to install the Audience app and click the Install button.
      Audience-Install-App
    7. To configure your plugin, enter the Content Type UID from which the target audience will be rendered, the Field UID, and the Group Title.
    8. Audience-Configurations
    9. On the UI Locations tab, you can see the predefined app locations. You can use the toggle button corresponding to each UI location to enable or disable it based on your requirements. Audience-UI-Locations
    10. Additional Resource: For more information on UI locations, please refer to the Installed Apps guide.

    11. Click the Save button.
    12. Click Open Stack to start using the plugin within your stack.
  3. Add the Audience Plugin within your JSON Rich Text Editor

    1. Go to your stack and click the Content Models icon on the left navigation panel, and click the + New Content Type button.
    2. Create a content type by adding relevant details and click the Save and proceed button.
    3. image2.png
    4. In the Content Type Builder page, add a JSON Rich Text Editor field in your content type by clicking the Insert a field link represented by a + sign.
    5. Under Select Plugin, select the Audience plugin, and click the Add Plugin(s) button.
    6. Marketplace_Audience_Extension.png
    7. After adding the plugin, click Save or Save and Close to save your changes.
    8. image6.png
    9. Now, create an entry for the Institution content type.
    10. Within your JSON Rich Text Editor add your content and click the Audience icon to customize which target audience can view the specific content.
    11. image12.png
    12. From the options, select the target audience (Faculty/Students/All) for your content and click the Add Selected button.
      1. If you want to select Faculty as the audience:
      2. image9.png
      3. If you want to select Students as the audience:
      4. image11.png
      5. If you want to select both Faculty and Students as the audience:
      6. image1.png
    Now, the content you add would be visible to the faculty, students, or both. You need not create separate entries to add different content. You can use the audience plugin and customize your content as per your target audience.

image4.png

Was this article helpful?
^