Skip to content

Repository files navigation

Placeholder plugin for redactor

Adds a drop-down list of pre-defined placeholders that you can insert into the editor.

Works with 8.2.x

Example

Usage

You should define the placeholders before plugin init by adding them to the textarea as a data attribute.

var placeholders = [
    {
        name: "placeholder_name",
        value: "Placeholder display value"
    }
];

$('#redactor').data('placeholders', placeholders);

Add placeholder plugin to redactor.

$('#redactor').redactor({
    plugins: ['placeholders']
});

Drawbacks

Sadly redactor has no beforeSave callback, therefore you have to transform the placeholder spans back to text manually. If you do it on the client side you can use the plugin's getTransformedHtml method.

Placeholder plugin

Copyright (c) 2013, Oliver Kovacs (Zmetser) Licensed under the MIT License

Redactor

Copyright (c) 2009-2013, Imperavi Inc. License: http://imperavi.com/redactor/license/

About

Placeholder plugin for Redactor

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages