-
Notifications
You must be signed in to change notification settings - Fork 13
PluginPlaceholders
sonsoleslp edited this page Aug 17, 2018
·
4 revisions
If you want a plugin instance to be able to contain a box created by an other plugin, you will need to declare the property isComplex: true in the plugin configuration and to define an area destined to this purpose in the plugin's interface. In order to to this, you can make use of the component PluginPlaceholder.
Inside the function getRenderTemplate, you can declare one or more PluginPlaceholder componentes, which need the following properties:
-
pluginContainer: String with the unique key (within the plugin) that this container receives. -
pluginContainerName: It is the name used in the toolbar in order to identify one specific container in the toolbar for its configuration. If not specified, the container will be called "Container". -
pluginDefaultContent(opcional): Array with the default content that this container will have. It may be empty, but if you'd rather it had some plugin instances by default, it is necessary to define an array with as many elements as initial boxes in the container. Each element in the array will be an object with two keys:plugin, which contains the name of the plugin that you'd like to include by default, andinitialState, the initial state of the plugin's instance (it is only necessary to specify those fields of the initialState that differ from the default initial state). An example of the expected value for this field is the following:[{ plugin: 'BasicText', initialState: { __text: '<p>Hello</p>' } }]. -
pluginDataInitialHeight: The value of this attribute indicates the initial size that you want the container to be. It can be provided in any unit (relative or absolute). By default it is automatic.