Ckeditor Drupal 7

broken image


CKEditor is the WYSIWYG (What You See Is What You Get) editor of choice around the Digett office. While some may bemoan the use of a WYSIWYG editor at all, even an experienced developer can usually save a lot of time during content entry by using one. Drupal does not come with a built-in editor but there are many excellent options; CKEditor is the cream of the crop.

The CKEditor 3rd-party Software

There are always two parts to an HTML editor, the 3rd-party software and the Drupal module that integrates it with Drupal. As with any 3rd-party software, that component must be downloaded separately from its own site (not Drupal.org) and integrated with your Drupal site using a Drupal module downloaded from Drupal.org.

CKEditor in Drupal 7 has a variety of options available. It is best to only use the ones described below: Adding a Link. Camtasia for mac full. Highlight the text that you want to turn into a link. Select the Link control button on the toolbar: Select the type of link you want to add in the Link Type drop-down. Installing CKEditor in Drupal 7 By default, Drupal does not install any type of editor for adding styling to content. The good thing about that is you get to choose which one you want to use. The CKEditor is one of the most popular WYSIWYG editors and with version 3.6.1 the installation is a little simpler than previous versions.

  • CKEditor for Drupal 7 Plugins (Enterprise Version) This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2).
  • Toolbar Not working in Drupal 7. Hi, I installed CKEditor module and then downloaded latest CKEditor version. All is working except buttons that I selected in toolbar are not showing up. It keeps showing up few selected buttons. I am not sure what I might be doing wrong.
  • Drupal 7 Browsing for Media from CKEditor. Ask Question Asked 8 years, 8 months ago. Active 8 years, 8 months ago. Viewed 4k times 2. When using the add media button in the CKEditor in our Drupal 7 installation, and then clicking the Library tab, this is the dialog that we get: What we would like is the ability to have filters etc.

Some advantages of CKEditor over many of the other HTML editors available include:

  • Time-tested - CKEditor started out as FCKeditor in 2003.
  • Actively developed - There is a new incremental release at least every few months.
  • Popular - CKEditor/FCKeditor is by far the most used WYSIWYG editor on Drupal sites.
  • Extensible - There are many plugins specifically for Drupal that can be easily added. (e.g. IMCE, Media, Drupal Teaser Break, etc.)

Drupal Modules

Once you've reached the decision that CKEditor is your WYSIWYG of choice, you have two options for integrating it into your Drupal site.

  1. There is a module called Wysiwyg, which was built as a universal integration for all of the various HTML editors available for Drupal.
  2. The other module is called CKEditor - WYSIWYG HTML editor, and was designed to integrate only the CKEditor software into Drupal.

Wysiwyg Module

Since its creation, the Wysiwyg module has gained tremendous support as one of the most installed modules in all of Drupal. The feat that it accomplishes of allowing a site to use any WYSIWYG editor is impressive; it will even allow you to run multiple editors on the same site based on the input/text format chosen for a particular textarea. If you find yourself in need of this kind of feature, the WYSIWYG editor is the integration module for you.

Working
Ckeditor Drupal 7

CKEditor module

Ckeditor

The CKEditor module (in the form of FCKeditor module) has been around since November 2006. Since it is specifically designed for the CKEditor HTML editor, the settings available are much more complete; nearly any setting that could be manipulated in the CKEditor config files is available in the user interface of this module. We find that it's easier to setup and make adjustments with this module over the Wysiwg module. Some nice features are:

  • There is a drag and drop interface for the buttons that are displayed on the toolbar.
  • Each user can configure their own settings (if given permission).
  • The Styles select box can be added in each theme.
  • The editor is skinable.
  • Custom configuration settings can be added through the GUI.

Drupal 6 note from the project page: 'In version 6.x users were forced to define the set of include/exclude rules based on the ID of textarea or the path to the page. In Drupal 7 things are [simplified]. All you have to do is to pick up the input formats where CKEditor should be enabled.'

Since the CKEditor module has so many settings, I highly recommend following the installation instructions in the README file that come with the module. There are some settings that need to be changed in the ‘Filtered HTML' text format in order to make CKEditor function correctly and eliminate the need to give users permission to use the ‘Full HTML' format.

Results

We have chosen to use the CKEditor module with all of our Drupal 7 installations. Until the WYSIWYG module catches up on the feature set the CKEditor module will keep going strong, and it will continue to be my recommendation. If you have experience with or opinions about either of these modules, let us know in the comments.

Ckeditor Drupal 8

MONTHLY MARKETING INSIGHTS.

Get thought-provoking and actionable insights to improve how your firm makes a connection with your customers.

RELATED POSTS

LEAVE A COMMENT

Submitted by

On a recent project, we had a client who wanted the ability to have images in the body float left or right. What I wanted to see happen, as a front end developer, is that the images would simply have a class attached to them, and my external CSS would handle the floating.

Why a class (as opposed to inline styling?):

  • Cleaner markup in general
  • Style attributes were being stripped by our text format, and I didn't want to let any HTML fly within this format
  • Just adding a class would make future modifications easier (rather than trying to modify individual instances of inline styles)

Ckeditor Not Working Drupal 7

After an afternoon of experimentation, I found out you need two files added to your theme, and a weird trick to make sure it works.

I'm going to assume that you already have the CKEditor module up and running, and the CKEditor library itself has been installed in sites/all/libraries.

Adding new style options to CKEditor

The first step is to add the 'Styles' drop down to the editor itself.

  • Go to Configuration > Content Authoring > CKEditor
  • Next to the profile that you want to change, click 'Edit'
  • then on that page, open the 'Editor Appearance' fieldset
  • Scroll to the section where you can drag/drop items on the tool bar, and drag the 'Styles' box onto your tool bar

Save your changes, but keep the CKEditor page open, as we'll be revisiting it soon.

The first file that you will need to add to your theme is ckeditor.styles.js. This is what will dictate what style options appear in the dropdown that was just added to the toolbar.

The default file exists within the contributed module (presumably sites/all/modules/contrib/ckeditor/ckeditor.styles.js). I would suggest copying that file and putting it in the root of your theme.

World Premiere: London, Royal Opera House, 1951 (original four-act version)/1964 (revised version) An adaptation of Herman Melville's novella, Billy Budd is one of the most gripping and successful operas of the 20th century. Set almost entirely aboard a British warship, the drama is a stark morality play about the inherent difficulty of recognizing the difference between good and evil. World premiere: Royal Opera House, London, 1951 (original four-act version)/1964 (revised version) PROLOGUE. Captain Vere, as an old man, looks back on his life at sea and the mysterious workings of good and evil. Aboard the H.M.S. Indomitable during the French Wars of 1797. Billy budd opera plot summary.

When you look at the file, you will see that the styles are laid out in a fairly easy-to-understand JSON format.

Ckeditor Drupal 7 Tutorial

You can see how styles are described, and even have some visual design applied to them, so they appear a certain way within the drop down.

I didn't want any of these styles, so I commented out almost everything. What I did add looked like this:

Which, when configured (see below), will make two options appear in the drop down menu. When an image element is selected, and one of these options are applied, a class will be added to the image element - exactly what I wanted!

In order to get Drupal to have your new style options, though, you need to make CKEditor see your new file:

While setting it to 'Use Theme ckeditor.styles.js' will do the same thing in theory, in practice it doesn't work the way you expect. There is some nasty caching gremlin in the dark places of Drupal that will read your file once, but simply will ignore future changes. This issue has been raised for a while, but it's still exhibiting this behavior.

The weird trick to get around Drupal not seeing changes to ckeditor.styles.js

As noted at the very end of that Issue, a cache busting string will fix this issue. That's why I suggest you define the path to your ckeditor.styles.js. You can set it to something like this:

(The %t is a wildcard character that points to the active theme.)

And when you make future changes, just update v1 to v2 and so on. Drupal will see your changes, then.

Wysiwyg

Once you've defined your path, and hit save (and clear caches, just to be sure), now your custom style options should appear in the CKEditor toolbar. You can now select image elements that have been placed in the content, and apply classes to them via the options created.

You can try it out, and you should see something like this show up in your markup:

Which you can now style in your normal theme CSS, to float or do whatever else you want:

img.align-left {float: left;margin: 0 20px 20px 0;}

Changing the style inside the editor itself

You can also add custom CSS so that the editor itself reflects your style changes. What you need to do is to add another CSS file to your theme called that will be used by the editor.

Ckeditor

CKEditor module

The CKEditor module (in the form of FCKeditor module) has been around since November 2006. Since it is specifically designed for the CKEditor HTML editor, the settings available are much more complete; nearly any setting that could be manipulated in the CKEditor config files is available in the user interface of this module. We find that it's easier to setup and make adjustments with this module over the Wysiwg module. Some nice features are:

  • There is a drag and drop interface for the buttons that are displayed on the toolbar.
  • Each user can configure their own settings (if given permission).
  • The Styles select box can be added in each theme.
  • The editor is skinable.
  • Custom configuration settings can be added through the GUI.

Drupal 6 note from the project page: 'In version 6.x users were forced to define the set of include/exclude rules based on the ID of textarea or the path to the page. In Drupal 7 things are [simplified]. All you have to do is to pick up the input formats where CKEditor should be enabled.'

Since the CKEditor module has so many settings, I highly recommend following the installation instructions in the README file that come with the module. There are some settings that need to be changed in the ‘Filtered HTML' text format in order to make CKEditor function correctly and eliminate the need to give users permission to use the ‘Full HTML' format.

Results

We have chosen to use the CKEditor module with all of our Drupal 7 installations. Until the WYSIWYG module catches up on the feature set the CKEditor module will keep going strong, and it will continue to be my recommendation. If you have experience with or opinions about either of these modules, let us know in the comments.

Ckeditor Drupal 8

MONTHLY MARKETING INSIGHTS.

Get thought-provoking and actionable insights to improve how your firm makes a connection with your customers.

RELATED POSTS

LEAVE A COMMENT

Submitted by

On a recent project, we had a client who wanted the ability to have images in the body float left or right. What I wanted to see happen, as a front end developer, is that the images would simply have a class attached to them, and my external CSS would handle the floating.

Why a class (as opposed to inline styling?):

  • Cleaner markup in general
  • Style attributes were being stripped by our text format, and I didn't want to let any HTML fly within this format
  • Just adding a class would make future modifications easier (rather than trying to modify individual instances of inline styles)

Ckeditor Not Working Drupal 7

After an afternoon of experimentation, I found out you need two files added to your theme, and a weird trick to make sure it works.

I'm going to assume that you already have the CKEditor module up and running, and the CKEditor library itself has been installed in sites/all/libraries.

Adding new style options to CKEditor

The first step is to add the 'Styles' drop down to the editor itself.

  • Go to Configuration > Content Authoring > CKEditor
  • Next to the profile that you want to change, click 'Edit'
  • then on that page, open the 'Editor Appearance' fieldset
  • Scroll to the section where you can drag/drop items on the tool bar, and drag the 'Styles' box onto your tool bar

Save your changes, but keep the CKEditor page open, as we'll be revisiting it soon.

The first file that you will need to add to your theme is ckeditor.styles.js. This is what will dictate what style options appear in the dropdown that was just added to the toolbar.

The default file exists within the contributed module (presumably sites/all/modules/contrib/ckeditor/ckeditor.styles.js). I would suggest copying that file and putting it in the root of your theme.

World Premiere: London, Royal Opera House, 1951 (original four-act version)/1964 (revised version) An adaptation of Herman Melville's novella, Billy Budd is one of the most gripping and successful operas of the 20th century. Set almost entirely aboard a British warship, the drama is a stark morality play about the inherent difficulty of recognizing the difference between good and evil. World premiere: Royal Opera House, London, 1951 (original four-act version)/1964 (revised version) PROLOGUE. Captain Vere, as an old man, looks back on his life at sea and the mysterious workings of good and evil. Aboard the H.M.S. Indomitable during the French Wars of 1797. Billy budd opera plot summary.

When you look at the file, you will see that the styles are laid out in a fairly easy-to-understand JSON format.

Ckeditor Drupal 7 Tutorial

You can see how styles are described, and even have some visual design applied to them, so they appear a certain way within the drop down.

I didn't want any of these styles, so I commented out almost everything. What I did add looked like this:

Which, when configured (see below), will make two options appear in the drop down menu. When an image element is selected, and one of these options are applied, a class will be added to the image element - exactly what I wanted!

In order to get Drupal to have your new style options, though, you need to make CKEditor see your new file:

While setting it to 'Use Theme ckeditor.styles.js' will do the same thing in theory, in practice it doesn't work the way you expect. There is some nasty caching gremlin in the dark places of Drupal that will read your file once, but simply will ignore future changes. This issue has been raised for a while, but it's still exhibiting this behavior.

The weird trick to get around Drupal not seeing changes to ckeditor.styles.js

As noted at the very end of that Issue, a cache busting string will fix this issue. That's why I suggest you define the path to your ckeditor.styles.js. You can set it to something like this:

(The %t is a wildcard character that points to the active theme.)

And when you make future changes, just update v1 to v2 and so on. Drupal will see your changes, then.

Wysiwyg

Once you've defined your path, and hit save (and clear caches, just to be sure), now your custom style options should appear in the CKEditor toolbar. You can now select image elements that have been placed in the content, and apply classes to them via the options created.

You can try it out, and you should see something like this show up in your markup:

Which you can now style in your normal theme CSS, to float or do whatever else you want:

img.align-left {float: left;margin: 0 20px 20px 0;}

Changing the style inside the editor itself

You can also add custom CSS so that the editor itself reflects your style changes. What you need to do is to add another CSS file to your theme called that will be used by the editor.

I would suggest starting out with the default version of the CKEditor file, which can be found at /sites/all/libraries/ckeditor/contents.css. I simply copied that over to the root of my theme, and renamed it ckeditor.styles.css just to keep the name associated with the javascript file. Frostwire youtube download.

Within that file you can modify how the editor appears. You can do things like change the font that is used, the background color, etc. The sky is the limit - you can take it as far as you want.

Ckeditor Drupal 7 Install

You can also include styles for the new options that you just made available in your javascript file. I basically copied over exactly what I added to my main CSS file, so that now when someone selects an image and floats it, it will float within the editor.

Update Ckeditor Drupal 7

You will need to configure Drupal to see the new CSS, though. Back in the CKEditor Profile page, under 'CSS', under 'Editor CSS', I would suggest again using Define CSS and using a string with a cache buster, just like the JavaScript file.

So that is basically it. You need a couple files, one piece of voodoo, and now you can let users apply classes to elements within the CKEditor editor.





broken image