# Set display content (/en/realtime-media/im/build/notifications-and-event-handling/offline-push/set-display-content/web)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

You can configure the push title and content displayed in the notification bar by using push templates.

    ### Set the push template [#set-the-push-template]

    The default push template is mainly used when the default configuration provided by the server does not meet your needs. It allows you to set the global push title and push content. For example, the default settings provided by the server are push titles and content in English. If you need to use push titles and content in another language, you can set the push template in the corresponding language.

    #### Use the default push template [#use-the-default-push-template-2]

    To use the default template, create a default push template in [Agora Console](https://console.agora.io/v2) or [call RESTful API](/en/api-reference/api-ref/im/offline-push/offline-push-configuration). The template name is `default`. After setting, the default template is automatically used when pushing messages. You do not need to enter the template name when creating messages.

    Follow the steps below to create a default push template in [Agora Console](https://console.agora.io/v2):

    1. Log in to [Agora Console](https://console.agora.io/v2) and click **Project Management** in the left navigation bar.

    2. On the **Project Management** page, click **Config** in the **Action** column for the project that has Chat enabled.

    3. On the **Edit Project** page, in the **Features** area, click **Enable / Config** for Chat.

    4. On the project configuration page, select **Features** > **Push Template** , click **Add Push Template** , and configure the fields in the pop-up dialog box, as shown in the following figure:

       ![push\_add\_template](https://assets-docs.agora.io/images/im/push_add_template.png)

    5. Set **Template Name** to **default**, then set the **Title** and **Content** parameters, and click **OK**.

       | Parameter         | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Required |
       | :---------------- | :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
       | **Template Name** | String | Push template name. The default template is **default**.                                                                                                                                                                                                                                                                                                                                                                                                             | Yes      |
       | **Title**         | Array  | Push title. Can be set in the following ways: Enter a fixed push title. Use built-in variables and enter `{$fromNickname}, {$msg}`. Set custom variables through the value array. The field format is `{0} {1} {2} ... {n}`. If the default template is used, the first two settings do not need to pass in this parameter when creating a message; the server automatically obtains it. The third setting method needs to be passed in through the extension field. | Yes      |
       | **Content**       | Array  | Push content. Can be set in the following ways: Enter fixed push content. Use variables and enter `{$fromNickname}, {$msg}`. Set custom variables through the value array. The field format is `{0} {1} {2} ... {n}`. If the default template is used, the first two settings do not require parameters to be passed in when creating a message; the server automatically obtains them. The third setting method needs to be passed in through the extension field.  | Yes      |

    #### Use a custom push template [#use-a-custom-push-template-2]

    The steps to use a custom push template are as follows:

    1. If you use a custom push template, create a custom push template in [Agora Console](https://console.agora.io/v2) or [Call RESTful API](/en/api-reference/api-ref/im/offline-push/offline-push-configuration#create-a-push-template). For a description of the parameters in the **Add Push Template** dialog box, see [Use the default push template](#use-the-default-push-template). When using a custom template, regardless of how the **Title** and **Content** parameters are set, they must be passed in through the extension fields when creating a message.

    2. When creating a message, pass in the template name, push title, and push content by using the extension fields. The push title and content in the notification bar use the formats in the template, respectively:

       ```javascript
       // The following takes text messages as an example. The setting methods for other types of messages are the same.

       const sendTextMsg = () => {
         const options: AgoraChat.CreateTextMsgParameters = {
           chatType: chatType,
           type: "txt",
           to: targetUserId,
           msg: msgContent,
           ext: {
             em_push_template: {
               name: " templateName ", // Set the push template name.
               title_args: [" titleValue1 "], // Set the value array of the push title in the template. If the push title specified in the template is placeholder data, you can customize the title here; if the specified title is a fixed value, the title will be a fixed value when using this template.
               content_args: [" contentValue1 "], // Set the value array of the pushed content in the template. If the template content specified in the template is placeholder data, you can customize the content here; if the specified content is a fixed value, the content will be a fixed value when the template is used.
             },
           },
         };
         const msg = AgoraChat.message.create(options);
         chatClient.send(msg);
       };
       ```

       The JSON structure of the push template is as follows:

       ```json
       "em_push_template":{
               "name":"test6",
               "title_args":[
                   "test1"
               ],
               "content_args":[
                   `${fromNickname}`,
                   `${msg}`
               ]
       }
       ```

    
  
      
  
      
  
      
  
      
  
