Modules
Display conditions

Rate this page:

Confluence content byline item

The confluence:contentBylineItem module adds an entry to the content byline section, which is the part of the content under the title that includes metadata about contributors and more. The title, icon, and tooltip of the module render together as a list item.

In the app, the ContentBylineItem should be used along with InlineDialog UI kit components.

Properties

PropertyTypeRequiredDescription
key

string

Yes

A key for the module, which other modules can refer to. Must be unique within the manifest.

Regex: ^[a-zA-Z0-9_-]+$

functionstringThe content byline item module requires either a function for usage with the UI kit, or a resource when building with custom UI.A reference to the function module that defines the content byline item.
resourcestringA reference to the static resources entry that your content byline item wants to display. See resources for more details.
resolver{ function: string }Contains a function property, which references the function module that defines the configuration of resource. Can only be set if the module is using the resource property.
viewportSize'small', 'medium' or 'large'The display size of resource. Can only be set if the module is using the resource property. Remove this property to enable automatic resizing of the module.
titlestringYesThe title of the content byline item, which is displayed as a list item.
iconstring

The URL of the icon that's displayed as an icon next to the link title. A generic app icon is displayed if no icon is provided, or if there’s an issue preventing the icon from loading.

tooltipstringThe tooltip of the content byline item, which is displayed on hover.
descriptionstringThe description of the content byline item.
displayConditionsobjectThe object that defines whether or not a module is displayed in the UI of the app. See display conditions.
dynamicProperties{ function: string }Contains a function property, which references the function module that defines the configuration of resource. See Dynamic properties for more details.

Dynamic properties

Dynamic properties are used to dynamically update the title, icon, or tooltip properties of the confluence:contentBylineItem module. If provided in the manifest.yml file, Confluence attempts to retrieve the dynamic properties on the initial render of the app. To do this, the dynamicProperties handler function of the app is called. When the content byline item is clicked, the app renders in a dialog, where it can perform business logic updates. After the dialog is closed, the handler function is again called to retrieve updates, and then update the title, icon, or tooltip.

We're working on integrating 3LO consent with dynamic properties. If you’re using api.asUser().requestConfluence, and if your user doesn't provide consent for your app through another method, api.asUser().requestConfluence will fail to execute. The app will then use the properties configured in the manifest.yml file by default.

The app's handler function is passed two arguments: payload and context. The payload object has the following structure:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
interface Payload {
  // The cloudId for your site 
  cloudId: string;
  // A unique id for this instance of this component in the content
  localId: string;
  extension: {
    // The module type included in the manifest.yml file.
    // In this case, it is the "confluence:contentBylineItem" module.
    type: string;
    content: {
      // The unique identifier of the Confluence content
      id: string;
      // The type of Confluence content on which the invocation has occurred
      type: 'page' | 'blogpost' | 'space';
    };
    space: {
      // The key of the originating invocation space
      key: string;
    }
  };
}

The context object has the following structure:

1
2
3
4
5
6
interface Context {
  principal: {
    accountId: string;
  };
  installContext: string;
}

The handler function should return (or resolve with) a plain old JavaScript object with a title, icon, and tooltip as keys. These optional keys are only sent if their respective values require updating. Failure to provide a key would default to the last used value or the original values defined within the manifest.yml file.

Below is an example of a handler function returning a returned object:

1
2
3
4
5
6
7
function handlerFunction(contextPayload) {
  return {
    "title": "Updated title"
    "icon": "https://mydomain.com/my-icon.png",
    "tooltip": "Updated Tooltip"
  };
}

Check out the Page approver app as an example of an app that updates the title and tooltip on change, and prepopulates a default icon that's missing from the manifest.yml file.

Extension context

Custom UI

PropertyTypeDescription
typestringThe type of the module.

UI kit

PropertyTypeDescription
typestringThe type of the module.

Rate this page: