@tridion-sites/extensions
v3.0.0
Published
Tridion Sites Extensions API
Downloads
97
Readme
Tridion Sites Extensions API
@tridion-sites/extensions
provides an API for frontend extensions for Tridion Sites.
Getting Started
All extensions export an ExtensionModule
object. The initialize
function on this object receives an ExtensionBuilder
from Tridion Sites as its argument, which gives a developer access to the extensions API.
Common functionality
This functionality can be used in any extension point and is available throughout the application.
Hooks
| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | useConfirmation | Opens a confirmation dialog with the provided options | useHelloAction | | useNotifications | Provides ability to show notifications and save them in Message Center | useHelloAction | | useUserProfile | Provides access to the current user profile information | useHelloAction |
Components and styling
Components and style constants are provided so extensions can maintain a consistent look & feel with Tridion Sites.
Layout
💡 Tip: Layout components have an exposed className
prop. This allows custom styles to be added via styled-components or CSS modules.
| Name | Description | Example | | -------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Block | | Users List Item | | Center | | Schema Purpose Column | | Flex | | Number Field | | Stack | | Users List |
Other components
| Name | Description | Example | | ------------------------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Button | | | | Icon | | Smile Icon | | Link | | | | Text | | Number Field | | TextLink | | Item Link |
Style constants
| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | getBorderRadius | | Hex Color Picker | | getColorPalette | | | | getOpacityLevel | | | | getSpacing | | | | getTransitionDuration | | | | getZIndex | | |
Data loading
Mutations and queries provide a way to requires Tridion Sites data. They operate with model instances of @tridion-sites/models
package rather than simple objects of @tridion-sites/open-api-client
.
💡 Tip: Mutations and queries share cached data between the host application and extensions. This means that if provided request was already loaded somewhere else - it is going to be retrieved from the cache if applicable.
Queries
Queries provide a way of retrieving data from the backend as well as managing its loading and reloading.
| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | useActivityInstancesQuery | | | | useDefaultTranslationJobQuery | | | | useFavoritesQuery | | | | useItemBlueprintHierarchyQuery | | | | useItemChildrenQuery | | | | useItemClassifiedItemsQuery | | | | useItemDefaultDataQuery | | | | useItemHistoryQuery | | | | useItemPublishedPagesQuery | | | | useItemPublishedToQuery | | | | useItemPublishUrlsQuery | | | | useItemQuery | | Work Items Popover | | useItemsInProgressQuery | | | | useItemsQuery | | | | useItemsToPublishQuery | | | | useItemsToUnpublishQuery | | | | useItemTranslationInfoQuery | | | | useItemUsedByQuery | | | | useItemUsesQuery | | | | usePublicationBlueprintHierarchyQuery | | | | usePublicationsQuery | | | | usePublishableTargetTypesQuery | | | | useSearchInContainerQuery | | | | useSystemSearchQuery | | | | useUserGroupsQuery | | | | useUserProfileQuery | | | | useUsersQuery | | Users Page |
Mutations
Mutations provide a way of changing data on the backend as well as handling request execution.
| Name | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | useAddToBundleMutation | | | | useAssignActivitiesMutation | | | | useAssignActivityMutation | | | | useAutoClassifyItemMutation | | | | useAutoClassifyItemsMutation | | | | useChangeUserLanguageMutation | | Change Language to Dutch Action | | useChangeUserLocaleMutation | | | | useCopyItemMutation | | | | useCopyItemsMutation | | | | useCreateTranslationJobMutation | | | | useDeleteItemMutation | | | | useDeleteItemsMutation | | | | useFinishActivitiesMutation | | | | useFinishActivityMutation | | | | useFinishEditingItemMutation | | | | useFinishEditingItemsMutation | | | | useLocalizeItemMutation | | | | useLocalizeItemsMutation | | | | useMoveItemMutation | | | | useMoveItemsMutation | | | | usePublishItemsMutation | | | | useRemoveFromBundleMutation | | | | useRestartActivitiesMutation | | | | useRestartActivityMutation | | | | useRevertItemMutation | | | | useRevertItemsMutation | | | | useRollbackItemMutation | | | | useStartActivitiesMutation | | | | useStartActivityMutation | | | | useStartWorkflowMutation | | | | useUnlocalizeItemMutation | | | | useUnlocalizeItemsMutation | | | | useUnpublishItemsMutation | | | | useUpdateItemMutation | | | | useUploadMultimediaMutation | | |
Data Contexts
Tridion Sites contains nested data contexts. All extension points and hooks exist within a data context. Within any given data context, one can access both the data in that context and any parent data contexts. It is important to note where an extension is located to determine what data it can access.
💡 Tip: Some extensions might appear in multiple places. Hooks with optional contexts are provided for this purpose.
- Activities Explorer
- Activities Explorer Table
- Content Explorer
- Content Explorer Table
- Content Explorer Tree
- Content editors
- Bundle editor
- Category editor
- Component editor
- Folder editor
- Keyword editor
- Page editor
- Structure Group editor