Bitbucket modules
Common modules
Compass modules
Confluence modules
Jira modules
Jira Service Management modules
Rovo modules (Preview)

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.

For UI Kit 1, see the ContentBylineItem component documentation for an example.

Example of a Content byline item

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_-]+$

functionstringRequired if using UI Kit 1 or triggers.A reference to the function module that defines the module.
resourcestringRequired if using custom UI or the latest version of UI Kit.A reference to the static resources entry that your context menu app wants to display. See resources for more details.
render'native'Yes for UI Kit.Indicates the module uses UI Kit.
resolver{ function: string } or
{ endpoint: string }
Yes

Set the function property if you are using a hosted function module for your resolver.

Set the endpoint property if you are using Forge remote to integrate with a remote back end.

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.
titlestring or i18n objectYes

The title of the content byline item, which is displayed as a list item.

The i18n object allows for translation and is available to participants of the Internationalization for Forge EAP. See i18n object.

iconstring

The icon displayed next to the title.


For custom UI and UI Kit apps, the icon property accepts a relative path from a declared resource. Alternatively, you can also use an absolute URL to a self-hosted icon. See Icons for more information.

If no icon is provided, or if there's an issue preventing the icon from loading, a generic app icon will be displayed.

tooltipstring or i18n object

The tooltip of the content byline item, which is displayed on hover.

The i18n object allows for translation and is available to participants of the Internationalization for Forge EAP. See i18n object.

descriptionstring or i18n object

The description of the content byline item.

The i18n object allows for translation and is available to participants of the Internationalization for Forge EAP. See i18n object.

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.
keyboardShortcutobjectThe object that defines a keyboard shortcut to trigger this module. See keyboard shortcuts.

i18n object

Internationalization (i18n) for Forge apps is now available through Forge's Early Access Program (EAP). For details on how to sign up for the EAP, see the changelog announcement.

EAPs are offered to selected users for testing and feedback purposes. APIs and features under EAP are unsupported and subject to change without notice. APIs and features under EAP are not recommended for use in production environments.

For more details, see Forge EAP, Preview, and GA.

KeyTypeRequiredDescription
i18nstringYesA key referencing a translated string in the translation files. For more details, see Translations.

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.

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

1
2
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 id of the originating invocation space
      id: string;
      // The key of the originating invocation space
      key: string;
    }
  };
}

The context object has the following structure:

1
2
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
function handlerFunction(contextPayload) {
  return {
    "title": "Updated title",
    "icon": "https://mydomain.com/my-icon.png",
    "tooltip": "Updated Tooltip"
  };
}

When you use an icon in your dynamic properties, its source URL is subject to a permission check.

For an example of adding source URL permissions for your icon property, see External Permissions.

Bundled resources in the following formats are allowed by default:

  • resource:<resource key>;<relative path to resource>
  • data:image URIs

See Icons for more information about bundling icons as a resource.

When the source URL does not have the appropriate permissions, the dynamic properties are not loaded. The default configuration is used instead.

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

UI Kit and Custom UI

Use the useProductContext hook to access the extension context in UI Kit or getContext bridge method in custom UI.

PropertyTypeDescription
typestringThe type of the module.
content.idstringA string that represents the unique identifier of the `content` object
content.typestringA string that represents the unique key of the `content` object
space.idstringA string that represents the unique identifier of the `space` object.
space.keystringA string that represents the unique key of the `space` object.

UI Kit 1

PropertyTypeDescription
typestringThe type of the module.

Rate this page: