When developing an application, create UI extension points and add them to the server-side UI macros, such as HTML extensions, or the UI pages in the base application code.

Use a UI extension point to designate the specific location where data or objects can be sent to a registered custom UI macro and where returned results are processed.

Create a UI extension point

Create a UI extension point that you can place in the UI macros, such as HTML extensions, in the application code. By placing the UI extension point, you designate the specific location in the application code where data or objects can be sent to a customization and where data is returned.

Before you begin

Role required: admin or the specific role for the developer or administrator of the application
Note: To learn about application-specific administrator roles and delegated development, see Access control rules in application administration apps and Delegated development and deployment.

About this task

Define the content and structure for an extension point. This definition should describe how a customization should be structured, how it interacts with the application code, and how the data that is returned by a customization at the extension point is processed.

By creating a good definition, you provide a structure for the functionality of the extensions.

Procedure

  1. Navigate to All > System Extension Points > UI Extension Points.
  2. Click New.
  3. On the form, fill in the fields.
  4. Click Submit.

Add a UI extension point in the base application code

Add the UI extension point into a UI macro or HTML extension in the base application code. To add the extension point, place an API call that identifies the location at which registered custom artifacts execute.

Before you begin

Role required: admin or the specific role for the developer or administrator of the application

You must first create a UI extension point before you can add it to a UI macro or UI page in the application code.

Note: To learn about application-specific administrator roles and delegated development, see Access control rules in application administration apps and Delegated development and deployment.

Procedure

  1. In the application code, access the existing UI macro that you want to add a scripted extension point to or create a new one.
    To learn more about creating UI macros with jelly tags, see UI macros and Jelly tags.
  2. In the UI macro, add a jelly tag with a line of code at the location that you expect to collect and process custom UI macro output.
    Typically, this line of code contains:
    • A call_extension command that identifies the name of the UI extension point (for example, extension="global.KMArticle.ViewHeader") against which the custom UI macros are registered.
    • Arguments that are passed into the UI macro when it is rendered. For example, for a Knowledge Base article, knowledgerecord="${knowledgeRecord}" passes in the current knowledge record.
    • (Optional) If there are multiple implementations of this extension point, using a limit command specifies that x number of implementations should be returned (for example, limit="1"). This figure shows a UI macro that contains these commands.

    UI extension point with a call_extension command in application code