How to add a custom figure?
The Custom Figure plugin inserts/deletes custom figure into the authoring canvas. The plugin allows you to add buttons in toolbar, to add custom styles, to insert element in the authoring canvas and to add context menu for the same.
To add Custom Figure plugin to Quark Author:
- Create a folder feature in the directory qaservice/ext in the s3 bucket.
- Create a folder customFigure in the folder feature.
- Add the Custom Figure plugin to the folder customFigure.
The name of the folder customFigure must be the same as you have specified in the file qa-config.json under the property “extensions.”
Sample qa-config.json (available for every content type)
"extensions": [
"customFigure"
]
// Map a widget for a bodydiv
"editorconfigs": {
"ckeditorconfigs": [
{
"name": "canvas_WidgetToBodydivMapping",
"value": [
{
"widgetName": "custom-figure",
"bodydivType": "custom-figure"
}
]
}
]
}
"toolbar": {
"mainTabs": [
{
"id": "home",
"label": "Home",
"type": "main",
"mode": "any",
"items": [
"customFigureBtn" // Custom button defined in plugin.js
]
}
]
}
The folder customFigure also must contain the file “manifest.json” with the key “modules” with “type” defined as “qa-canvas-plugin” and “bundle” defined as JavaScript file path.
Sample manifest.json
{
"version": "0.0.1",
"modules": [
{
"type": "qa-canvas-plugin",
"name": "customFigure",
"bundle": "customFigure/plugin.js"
}
]
}