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.
On apps that use Custom UI, module content is displayed inside a special Forge iframe which has the sandbox attribute configured. This means that HTML links (for example, <a href="https://domain.tld/path">...</a>
) in this iframe won't be clickable. To make them clickable, use the router.navigate API from the @forge/bridge
package.
Property | Type | Required | Description |
---|---|---|---|
key |
| Yes | A key for the module, which other modules can refer to. Must be unique within the manifest. Regex: Known limitation and issues:
|
function | string | Required if using UI Kit 1 or triggers. | A reference to the function module that defines the module. |
resource | string | Required 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 Set the |
title | string or i18n object | Yes |
The title of the custom content. The |
description | string or i18n object |
The description of the content action. The | |
icon | string | An 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. | |
bodyType | string | Defines the content body type of this custom content. Currently, supported content body types are:
| |
supportedContainerTypes | string[] | Yes | Defines types that this custom content can be contained in. Currently, supported content types:
|
supportedChildTypes | string[] | Defines types that can be contained in this custom content. Currently, supported content types:
| |
supportedSpacePermissions | string[] | 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. | |
indexing | boolean | Defines whether this content type is indexed and displayed in search results. | |
preventDuplicateTitle | boolean | Defines whether Confluence should prevent content with duplicate titles from being created in the same space or container. |
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.
Key | Type | Required | Description |
---|---|---|---|
i18n | string | Yes | A key referencing a translated string in the translation files. For more details, see Translations. |
Use the useProductContext hook to access the extension context in UI Kit or getContext bridge method in custom UI.
Property | Type | Description |
---|---|---|
type | string | The type of the module. |
Property | Type | Description |
---|---|---|
type | string | The type of the module. |
Rate this page: