Skip to content

Kiln APIs

Nelson Pecora edited this page May 8, 2017 · 1 revision

Starting from v1.0, Kiln has a number of APIs you can use to add custom functionality.

Behaviors

You can add custom behaviors to window.kiln.behaviors. See the migration guide for details.

Panes

You can add custom panes to window.kiln.panes. See the migration guide for details.

Plugins

You can add custom plugins to window.kiln.plugins. See the migration guide for details.

Validators

You can add custom pre-publish validators to window.kiln.validators. See the migration guide for details.

Helpers

You can add custom handlebars helpers to window.kiln.helpers, and they'll be made available for handlebars re-rendering on the client-side. See the migration guide for details.

Buttons

You can add custom buttons to both the component selectors and the toolbar. Add selector buttons by adding your vue component to the window.kiln.selectorButtons object and it'll appear between the "Settings" and "Remove" buttons in the expanded component selector, if they exist. Note: Make sure you include a v-if directive on your button if you don't want to display it on every component's selector.

You can add custom toolbar buttons to window.kiln.toolbarButtons in the same way. They'll display to the right of the "Redo" button in edit mode, and between the "Clay Menu" and "Edit" buttons in view mode. As with selector buttons, use v-if to determine if your button should display.