Display conditions
Modules

Rate this page:

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 be under a space container and have a page 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:DEVELOPMENT:customer

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

Known limitation and issues:

  • a key must be in lower case for advanced search to work
functionstringThe content action 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 app that renders custom content. This function must return the Custom Content component.
resourcestringA reference to the static resources entry that your custom content app 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.
titlestringYesThe 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
descriptionstringThe description of the content action.
iconstringAn absolute URL to the icon that represent the custom content.

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.

Extension context

Custom UI

PropertyTypeDescription
typestringThe type of the module.

UI kit

PropertyTypeDescription
typestringThe type of the module.

Rate this page: