You are here

README.txt in CKEditor Templates 8

INTRODUCTION
------------
This module integrates the CKEditor templates plugin.

It provides a dialog to offer predefined content templates - with page layout,
text formatting and styles. Thus, end users can easily insert pre-defined
snippets of html in CKEditor fields.

* For a full description of the module, visit the project page:
   https://www.drupal.org/project/ckeditor_templates

 * To submit bug reports and feature suggestions, or to track changes:
   https://www.drupal.org/project/issues/ckeditor_templates?categories=All

AUDIENCE
---------
This module is intended for themers who can manage custom ckeditor templates
from their theme. As is, it doesn't provide any fonctionnality.

REQUIREMENTS
------------
This module requires to install the CKEditor "Templates" plugin.
http://ckeditor.com/addon/templates

INSTALLATION
------------
Download the CKEditor "Templates" plugin on the project page :
http://ckeditor.com/addon/templates
Create a libraries folder in your drupal root if it doesn't exist
Extract the plugin archive in the librairies folder

Then install this Drupal module as you would normally install a contributed
Drupal module. Visit:
https://www.drupal.org/documentation/install/modules-themes/modules-8 for
further information.

CONFIGURATION
------------
- First, you need to add the plugin button in your editor toolbar.
Go to the format and editor config page and click configure on the format your
want to edit :
http://drupalvm.dev/admin/config/content/formats
- Add the templates button to the toolbar
- copy the file ckeditor_templates.js.example from the module templates folder
to your theme templates folder, rename it without .example and customize it :
    x edit the image_path variable to link to your thumbnail folder
    x copy the standard images from the libraries/templates/templates/images
    folder and place them in the folder created previously (image_path).
    x change the templates array in your custom ckeditor_templates.js to include
    any custom templates you want your users to have access to.

If you want to place your template file in a different folder, you can set the
path on the Editor config page.

If you have a particular setup with non standard path and your template file is
not found, you can always specify any custom path in the Editor Config Page,
found at "Configuration", "Text formats and editors". Choose the editor type you
want to expose the templates to and set path parameter at "Templates",
"Templates Definition File", in the "CKEditor plugin settings" section.

WARNING
--------
Depending on the configuration of your formats, CKEditor can be restrictive
about authorized HTML tags. Make sure to use compatible HTML tags in your
templates.

ROAD MAP
---------
Two features could be added :
- Allowing to add multiple template files so that you don't have to write all
your templates in one big file
- Allow to restrict for one editor the template displayed. Thus you could have
10 templates in a file and display only 3 of them on a specific format.


MAINTAINERS
-----------

Current maintainers:
 * Lucas Le Goff (lucaslg) - https://www.drupal.org/user/3128975

This project has been sponsored by:
 * Micropole
   Visit https://www.micropole.com for more information.

File

README.txt
View source
  1. INTRODUCTION
  2. ------------
  3. This module integrates the CKEditor templates plugin.
  4. It provides a dialog to offer predefined content templates - with page layout,
  5. text formatting and styles. Thus, end users can easily insert pre-defined
  6. snippets of html in CKEditor fields.
  7. * For a full description of the module, visit the project page:
  8. https://www.drupal.org/project/ckeditor_templates
  9. * To submit bug reports and feature suggestions, or to track changes:
  10. https://www.drupal.org/project/issues/ckeditor_templates?categories=All
  11. AUDIENCE
  12. ---------
  13. This module is intended for themers who can manage custom ckeditor templates
  14. from their theme. As is, it doesn't provide any fonctionnality.
  15. REQUIREMENTS
  16. ------------
  17. This module requires to install the CKEditor "Templates" plugin.
  18. http://ckeditor.com/addon/templates
  19. INSTALLATION
  20. ------------
  21. Download the CKEditor "Templates" plugin on the project page :
  22. http://ckeditor.com/addon/templates
  23. Create a libraries folder in your drupal root if it doesn't exist
  24. Extract the plugin archive in the librairies folder
  25. Then install this Drupal module as you would normally install a contributed
  26. Drupal module. Visit:
  27. https://www.drupal.org/documentation/install/modules-themes/modules-8 for
  28. further information.
  29. CONFIGURATION
  30. ------------
  31. - First, you need to add the plugin button in your editor toolbar.
  32. Go to the format and editor config page and click configure on the format your
  33. want to edit :
  34. http://drupalvm.dev/admin/config/content/formats
  35. - Add the templates button to the toolbar
  36. - copy the file ckeditor_templates.js.example from the module templates folder
  37. to your theme templates folder, rename it without .example and customize it :
  38. x edit the image_path variable to link to your thumbnail folder
  39. x copy the standard images from the libraries/templates/templates/images
  40. folder and place them in the folder created previously (image_path).
  41. x change the templates array in your custom ckeditor_templates.js to include
  42. any custom templates you want your users to have access to.
  43. If you want to place your template file in a different folder, you can set the
  44. path on the Editor config page.
  45. If you have a particular setup with non standard path and your template file is
  46. not found, you can always specify any custom path in the Editor Config Page,
  47. found at "Configuration", "Text formats and editors". Choose the editor type you
  48. want to expose the templates to and set path parameter at "Templates",
  49. "Templates Definition File", in the "CKEditor plugin settings" section.
  50. WARNING
  51. --------
  52. Depending on the configuration of your formats, CKEditor can be restrictive
  53. about authorized HTML tags. Make sure to use compatible HTML tags in your
  54. templates.
  55. ROAD MAP
  56. ---------
  57. Two features could be added :
  58. - Allowing to add multiple template files so that you don't have to write all
  59. your templates in one big file
  60. - Allow to restrict for one editor the template displayed. Thus you could have
  61. 10 templates in a file and display only 3 of them on a specific format.
  62. MAINTAINERS
  63. -----------
  64. Current maintainers:
  65. * Lucas Le Goff (lucaslg) - https://www.drupal.org/user/3128975
  66. This project has been sponsored by:
  67. * Micropole
  68. Visit https://www.micropole.com for more information.