Documentation

Templates

json #

Type: Boolean

Default: false

This setting allows you to get templates from JSON file.

ArticleEditor('#entry', {
    templates: {
        json: '/my-templates/templates.json'
    }
});

Example of JSON:

{
    "mytemplate": {
        "name": "My Template",
        "html": "<p>Hi everyone! This is my template</p>"
    },
    "mytemplate2": {
        "name": "My Other Template",
        "html": "<p>Hi everyone! This is my other template</p>"
    }
}

Or you can set the JSON object directly to the setting like this:

ArticleEditor('#entry', {
    templates: {
        json: {
            "mytemplate": {
                "name": "My Template",
                "html": "<p>Hi everyone! This is my template</p>"
            },
            "mytemplate2": {
                "name": "My Other Template",
                "html": "<p>Hi everyone! This is my other template</p>"
            }
        }
    }
});