Accueil
L'autonomisation technologique par l'innovation collective

Installing a wysiwyg editor on Drupal 7

Duration: about half an hour. Skill level: Beginner. Following is a step by step tutorial on installing a wysiwyg editor on Drupal 7 (for Drupal 6 click here). Some notes (1) none of this works with features for the moment, so if you are using a dev-stage-prod development workflow, you must follow the tutorial on your production site. (2) this tutorial does not cover how to enter images in text using wysiwyg. (3) This tutorial assumes that users who will have access to the wysiwyg editor are fully trusted.

Basic setup

Installing the wysiwyg editor.

  • admin/people/permissions/roles: add a role called "wysiwyg user". Users with this role are considered trusted, and will be presented with wysiwyg text areas and Full HTML text format by default. Note that users with the "administrator" role will also be able to use the wysiwyg editor. Use the "wysiwyg user" role for more fine-grained control over users' permissions.
  • Download and install wysiwyg. This is the best module for the job because it links a wysiwyg editor to a specific text format.
  • admin/config/content/wysiwyg: if no editor is installed, choose one (I like FCKeditor), and install it into your sites/all/libraries, sites/www.koumbit.org/libraries, or sites/example.com/libraries folder, depending on your installation. If you're not sure where to put it, put it in sites/all/libraries.
  • admin/config/content/wysiwyg: refresh this page and associate Full HTML with your editor.
  • admin/config/content/wysiwyg/profile/full_html/edit: In the buttons and plugins section, activate some buttons you would like on your editor. I like to put bold, italic, bullet list, numbered list, HTML block format.

Setting the default text format

The default text format for all users is filtered HTML, the safest text format available. We need to make full HTML the default text format for trusted users, i.e. users with the "wysiwyg user" role.

  • admin/config/content/formats/full_html: check "wysiwyg user", giving users with that role access to the full HTML input format
  • admin/config/content/formats: drag "Full HTML" to the top of the list and click save, making that format the default for users who have access to it

Testing

We now need to make sure that users with the "wysiwyg user" or "administrator" role can enter text using a wysiwyg editor. Presumably, if you got this far without any "access denied" messages, you already have the "administrator" role.

  • node/add/page: voilà, you have a wysiwyg editor.

Comments? Leave them here.