TemplateConfig
interface
The configuration of the template feature.
ClassicEditor
.create( {
template: ... // Template feature configuration.
} )
.then( ... )
.catch( ... );
See all editor options.
Properties
-
definitions : Array<TemplateDefinition> | undefined
module:template/template~TemplateConfig#definitions
A list of all template definitions to be displayed in the
'insertTemplate'
UI dropdown.An example configuration:
{ template: { definitions: [ { title: 'Issue acknowledgement (plain text)', data: 'Dear customer, thank you for your report! The issue is currently being worked on by our development team.' }, { title: 'Signature (multi-line)', data: '<p><b>Jane Doe</b></p><p>Marketing Specialist at <a href="https://example.com>Example.com</a></p>', description: 'Author signature with the link to the website.' }, { title: 'Example table', data: '<table><tr><td>Cell #1</td><td></td></tr><tr><td></td><td>Cell #2</td></tr></table>', icon: '<svg viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg">...</svg>', description: 'This template inserts a table.' }, { title: 'Insert userAgent data', data: navigator.userAgent }, { title: 'Insert translate to English link (function)', data: () => '<a href="' + location.href + '/en" title="Translate to English">Translate to English</a>' }, // ... ] } }