setBlockData EDITOR
¶
setBlockData API is used to change meta data of any content block in INK Editor.
Syntax¶
setBlockData(data : Object, path : Array<Number>)
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import INKAPI from './inkapi.js'
INKAPI.ready(() => {
const EDITOR = INKAPI.editor;
const data = {
title: "my favorite cat",
caption: "This is a picture of my favorite cat",
alt: "Cat Playing",
};
EDITOR.setBlockData(data, [3]);
});
|
Parameters¶
Name |
Type |
Description |
---|---|---|
options |
|
Required. data to be implemented on block. |
path |
|
Required. Path of the block. |
options¶
Name |
Type |
Description |
---|---|---|
file |
|
sets src url for the image block. |
type |
|
this option can change block type. Valid block types are: |
title |
|
sets title for the image block. |
caption |
|
sets caption text for the image block. |
alt |
|
sets alt text for the image block. |
size |
|
sets image size range between 20 - 100. |
quality |
|
set image quality range between 30 - 100. |
align |
|
Set alignment for the block. Valid alignments are: |
Note
Learn more about how blocks work in INK editor here.