CKBoxConfig (ckbox)
@ckeditor/ckeditor5-ckbox/src/ckboxconfig
The configuration of the CKBox feature.
The minimal configuration for the CKBox feature requires providing the
config.ckbox.tokenUrl
:
ClassicEditor
.create( editorElement, {
ckbox: {
tokenUrl: 'https://example.com/cs-token-endpoint'
}
} )
.then( ... )
.catch( ... );
Hovewer, you can also adjust the feature to fit your needs:
ClassicEditor
.create( editorElement, {
ckbox: {
defaultUploadCategories: {
Bitmaps: [ 'bmp' ],
Pictures: [ 'jpg', 'jpeg' ],
Scans: [ 'png', 'tiff' ]
},
ignoreDataId: true,
serviceOrigin: 'https://example.com/',
tokenUrl: 'https://example.com/cs-token-endpoint'
}
} )
.then( ... )
.catch( ... );
See all editor options.
Filtering
Properties
-
defaultUploadCategories : null | Record<string, Array<string>> | undefined
module:ckbox/ckboxconfig~CKBoxConfig#defaultUploadCategories
Defines the categories to which the uploaded images will be assigned. If configured, it overrides the category mappings defined on the cloud service. The value of this option should be an object, where the keys define categories and their values are the types of images that will be uploaded to these categories. The categories might be referenced by their name or ID.
Example:
const ckboxConfig = { defaultUploadCategories: { Bitmaps: [ 'bmp' ], Pictures: [ 'jpg', 'jpeg' ], Scans: [ 'png', 'tiff' ], // The category below is referenced by its ID. 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': [ 'gif' ] } };
Defaults to
null
-
defaultUploadWorkspaceId : string | undefined
module:ckbox/ckboxconfig~CKBoxConfig#defaultUploadWorkspaceId
Defines the workspace id to use during upload when the user has access to more than one workspace.
If defined, it is an error, when the user has no access to the specified workspace.
-
ignoreDataId : boolean | undefined
module:ckbox/ckboxconfig~CKBoxConfig#ignoreDataId
Inserts the unique asset ID as the
data-ckbox-resource-id
attribute. To disable this behavior, set it totrue
.Defaults to
false
-
language : string | undefined
module:ckbox/ckboxconfig~CKBoxConfig#language
-
serviceOrigin : string | undefined
module:ckbox/ckboxconfig~CKBoxConfig#serviceOrigin
Configures the base URL of the API service. Required only in on-premises installations.
Defaults to
'https://api.ckbox.io'
-
theme : string | undefined
module:ckbox/ckboxconfig~CKBoxConfig#theme
The theme for CKBox dialog.
-
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.