In TinyMCE, CK Editor and FCK Editor, there is a template function, which allows a user to select a HTML template from a drop-down and insert it into the WYSIWYG text-area. This module supports those features for use with the WYSIWYG API.

Note for Drupal 8 and installation via composer

In order to allow composer to find a required library from CKEditor, you have to add something like this to the root composer.json of your project before you download and install this module:

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "package",
            "package": {
                "name": "ckeditor/templates",
                "type": "drupal-library",
                "version": "4.5.7",
                "dist": {
                    "type": "zip",
                    "url": "http://download.ckeditor.com/templates/releases/templates_4.5.7.zip",
                    "reference": "master"
                }
            }
        }
    ]
}

Note for CKEditor 4.x users

Due to major changes in the API of CKEditor 4.x there are a few things no longer working which is not a limitation of the Wysiwyg Template module and can't be addressed here. The good news: the Wysiwyg module is dealing with those changes and as of March 2014 it is confirmed that the latest 7.x-2.x-dev release and their soon to be released 7.x-2.3 version are working just fine with CKEditor 4.3.3 and later. Note: You have to use the full version of the CKEditor, not the standard version (or at least include their template plugin if you custom build your CKEditor).

Dependencies

* Wysiwyg API
* or in 7.x-2.10, CK Editor

Installation

* Install as usual, see http://drupal.org/node/70151 for further information.

* Go to Administer > Site configuration > Wysiwyg
- click "edit" to set up your editor profile
- under "Buttons and Plugins" you'll see "Insert Templates" as a new option

Configuration

* Administer > Site configuration > Wysiwyg > Add Template to create a new template.

* Administer > Site configuration > Wysiwyg > List Templates to manage your existing templates.

Credit

Originally written by Jen Lampton.

Supporting organizations: 

Project Information

Downloads