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

Confluence custom content

The confluence:customContent module registers a new custom content type in Confluence that behaves like built-in content types, such as page, blog post or comment. After registering a new type, the corresponding custom content can be created by one user then listed, indexed and displayed in quick and advanced search results.

Custom content must respect the content type hierarchy by providing container and child types. For example, custom content can be created under a page container and have a comment child or an attachment child. Custom content can even be a parent or child to another piece of custom content, although in this case, both custom content types must be registered in the same app. See the supportedContainerTypes and supportedChildTypes parameters in the manifest description.

To retrieve, create, update, and delete custom content, use the corresponding REST API. As an input parameter for these requests, the content type key should be structured as follows:

forge:[APP_ID]:[ENVIRONMENT_ID]:[MODULE_KEY].

Where:

  • forge: The prefix for content type created with Forge.
  • APP_ID: The identifier for your Forge app. To get the app ID, use the useProductContext hook. The app ID is a part of the localId attribute.
  • ENVIRONMENT_ID: The environment identifier where the app was deployed. For more details, see Environments and versions. To get the environment ID, use the useProductContext hook.
  • MODULE_KEY: Unique confluence:customContent module key.

For example:

forge:b44c55b2-251f-45e3-8ea4-b56762f82e8a:f7522737-117c-46e7-a7ca-03a73c99afcf:customer

For UI Kit 1, SpaceCustomContentListView and PageCustomContentListView components can be used in other Forge modules (like confluence:spacePage or confluence:contentAction) to display a list of custom content created in a space or page. For more complex user interfaces, you can create a custom list component. Regardless, all custom content created within a page is available under Page -> Action Menu -> Attachments -> Custom Contents. On this page, each type of custom content is grouped within a separate tab.

The confluence:customContent module defines the app that is rendered to display custom content. This app is rendered under /display/:spaceKey/customcontent/:customContentId url inside the main content area of the Confluence.

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

resourcestringIf using Custom UI or modern versions of UI KitThe key of a static resources entry that your module will display. See resources for more details.
render'native'If using modern versions of UI KitIndicates the module uses UI Kit.
functionstringDeprecated Required if using UI Kit 1The key of a function module that returns a UI Kit 1 component.
resolver{ function: string } or
{ endpoint: string }

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.

titlestring or i18n objectYes

The title of the custom content.

This title appears on the Confluence page, which shows all custom content created within a page, and on the advanced search page in the `type` dropdown list

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 action.

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

iconstringAn absolute URL to the icon that represent the custom content.

In UI Kit 1, it is used in SpaceCustomContentListView and PageCustomContentListView components next to each custom content title and in a search result page. Relative URLs aren't supported. A generic app icon is displayed if no icon is provided.
bodyTypestringDefines the content body type of this custom content. Currently, supported content body types are:
  • storage: This is Confluence's default storage representation which can be rendered using the Content Body Conversion API
  • raw: This representation is used for storing raw data in the body that is not storage format. This format is opaque to Confluence.
If `bodyType` is not defined, `storage` format is used by default
supportedContainerTypesstring[]YesDefines types that this custom content can be contained in. Currently, supported content types:
  • space: For this content type a custom content can be created directly in a space.
  • page: This custom content can be contained in a page.
  • blogpost: This custom content can be contained in a blog post.
  • Other custom content type registered in this manifest, in the form of this:[OTHER_MODULE_KEY]
supportedChildTypesstring[]Defines types that can be contained in this custom content. Currently, supported content types:
  • attachment: This custom content can contain attachments.
  • comment: This custom content can contain comments.
  • Other custom content type registered in this manifest, in the form of this:[OTHER_MODULE_KEY]
supportedSpacePermissionsstring[]Defines the space permissions that this custom content supports. Allowable values are : read, create and delete. These permissions must be granted through the space permissions UI in order to perform the given operation.

If no space permissions are defined, the default permissions are used.
indexingbooleanDefines whether this content type is indexed and displayed in search results.
preventDuplicateTitlebooleanDefines whether Confluence should prevent content with duplicate titles from being created in the same space or container.

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.

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.

UI Kit 1

PropertyTypeDescription
typestringThe type of the module.

Rate this page: