Wordpress-like configuration for TinyMCE in Drupal
I am using Drupal's WYSIWYG module, and i have added the latest TinyMCE and have configured it succesfully. Now I would like it to display its buttons and toolbars precisely the way Wor开发者_StackOverflow中文版dpress displays them. How should I proceed from now?
drupal wysiwyg implementation is terrible. i gave up on tinymce and decided to go with ckeditor instead (i could never get tinymce to work with file and image uploads) my current setup works like this (disclaimer - don't fiddle with this stuff on a production environment, rather play around on your dev server first):
- download the ckeditor source from the ckeditor site and insert into your libraries (/sites/all/libraries).
- install the ckeditor module
- install the better_formats module
- install the imce module (may already be active)
- install the imce_style module (makes imce look a bit more bearable)
- disable wysiwyg and wysiwyg_api_bridge and imce_wysiwyg_api_bridge if they are installed
- copy ckeditor.config.js from the ckeditor module dir and drop it in your theme dir (that way you don't overwrite your config if you update the module)
- edit this file to set up a new toolbar-set or alter one of the existing ones. the file should be fairly self-explanatory.
- make sure the imce plugin, drupal page break plugin and whatever else you need is activated for this toolbar.
- go to your ckeditor options in drupal admin: admin/settings/ckeditor, choose the desired ckeditor profile and edit the settings, making sure the following is set:
- select: editor appearance > toolbar > [toolbar you configured in point 9]
- select: filebrowser > imce
- select: advanced options > load method > ckeditor.js
- select: "load ckeditor.config.js from theme path"
- the rest is up to your discretion
- edit the global profile settings to work with the textareas you specifically want.
- make sure your files directory is set and writable for imce if you want to upload files.
this took me about 3 days to get right. you can also set ckeditor to load your theme css so that styles within the editor reflect those on the rest of the site, and you can configure custom css classes to appear in the toolbar which reflect the styles on your site.
hope it helps somewhat.
You'll want to enable and configure this slew of modules:
- WYSIWYG
- Filefield
- Imagefield
- Image Resize Filter
- Filefield Sources
- WYSIWYG Imagefield
- Insert
This will allow you to first, choose your favorite supported WYSIWYG, be it CKEditor, TinyMCE or any of the others supported by the WYSIWYG API. Additionally, WYSIWYG is aware of Drupal input formats, so you can configure a different set of available buttons depending on the input format that is selected (Better Formats module can help out with this).
Then, configure your content types to have an Imagefield. Set the display of this field to be hidden, and configure the Insert/WYSIWYG Imagefield modules so that images are added via the WYSIWYG's native image button.
You should then be able to add the aforementioned image field to any content types you wish to enable this image upload behavior on.
Some of these configurations can be exported via the Features and Strongarm modules, which will save you time setting them up on additional sites.
精彩评论