I have attached a screen shot of the global profile where the include/exclude options for the editor are missing in the Global Profile configuration. The options are also missing from the Node/Content edit screen where they usually are next to the Text Format and "Switch to plain text" items.

CommentFileSizeAuthor
global_profile_ckeditor.jpg101.82 KBwickedskaman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Scott Robertson’s picture

I've noticed this as well. The "Visibility settings" section seems to be missing in both the global profile and user-created profiles.

amateescu’s picture

I just closed two issues that were duplicates of this one. I'm sure I read somewhere what happened to the Include/Exclude options but I just can't remember where because I was in a hurry.

Can you please put some notes about this in the release node for the next version? :)

pyxio’s picture

Does anybody know what happen to the visibility settings? I guess they are pretty important ;o)

dczepierga’s picture

Status: Active » Fixed

Include/Exclude options are not needed in D7, because CKEditor module use input format to attach the editor.
So now u should customize text formats which are build into Drupal 7.

In summary, everything works as designed and include/exclude option in not needed here.

wickedskaman’s picture

Status: Fixed » Needs review

What about when CKEditor appears in non node edit/create text areas such as in Rules Import/Export feature. The editor in the past has prevented functionality in these text areas to malfunction.

dczepierga’s picture

But each textarea in Drupal should have input format type, in other way if it doesn't have input format the CKEditor shouldn't enable there. If the CKEditor enable they must use one of the input formats where CKEditor is enabled or we have bug in CKEditor module.
Could u give any example / module where u found this problem??

wickedskaman’s picture

Status: Needs review » Closed (works as designed)

I've seen this behavior in 6.x so it was really more of a question about new functionality. I shouldn't have changed the issue status. Sorry about that.

If I see the issue I will update. Thanks for the prompt, patient responses! :)

pyxio’s picture

For example, how do I disable the text editor for the comments text area? I have assigned it as plain text profile to the best of my knowledge and the rich text editor still appears. The tight granular control of the previous versions seems much better to me.

3rdLOF’s picture

YEs, this is still confusing to me.

So how you disable the rich editor in fields that are not CCK like Core or Modules?

3rdLOF’s picture

Could some of the behaviors listed here be due to User1 status. I mention this because while testing Text Formats I noticed that under User 1 all text formats are shown regardless of limitations set by the role configuration of each.

For example, my user 1 is role "IT administrator", which only has access to Full HTML, Plain text and PHP. Yet, as User 1, all text Formats (Full, Filtered, Plain PHP) appear in ANY text area.

Not that it answers the original question, but I wonder if some of the behaviors are because of this.

jakew’s picture

I agree with talengix - I use the ckeditor module as opposed to the WYSIWYG module because it allows tight control over exactly where the editor appears. Now that the Drupal 7 version lacks this feature, I have no reason to use it (and also no choice of a text editor that easily allows including/excluding specific fields).

3rdLOF’s picture

Status: Closed (works as designed) » Closed (won't fix)

Change to WON'T FIX because, which is a more proper labeling for this issue.

winawer’s picture

Hello ereryone,
I really disappointed about removing include/exclude option from CKEditor.
Here is another example that show we need this option:

In node edit page, I Want to load CKEditor in "body" but don't in "Summary". Now CKEditor loads in both.

Regards
--
Winawer

Mark Nielsen’s picture

+1 to #13. Probably the CKEditor module should exclude the rich text editor from Summaries anyway, but at the least we need an option.

Also, the editor doesn't show up when editing things like Views Headers - regardless of the Input Format selected. Would be nice to add it for those things.

Is there a way to do these things in ckeditor.config.js?

mkesicki’s picture

@Mark Nielsen ,
CKEditor doesn't show in Views headers in Drupal 7 , because Views developers use #wysiwyg attribute to disable these fields for Wysiwyg editor. We should respect this.

Mark Nielsen’s picture

Fair enough. But it would also be nice to support summaries that are plain text, or at least provide that option.

Poieo’s picture

@dczepierga - Don't you think we might want to exclude an editor from a Full HTML field? There are a thousand use cases.

For example, you're using a text area to add code to a node such as social media buttons or any other plugin requiring you to paste code onto a page. Why should be have to 'switch to plain text editor' or click the 'source' button? What is wrong with providing the option to disable CKEditor on a field by field basis instead of assuming you've handled every use case?

Thanks for all your hard work, but there is obviously a demand for this feature whether you deem it necessary or not.

hanna_ulrika’s picture

Hi,
I have to agree with some of the previous comments. I too, miss the ability to exclude the editor from individual fields. I have several nodes where I want both Full HTML and the ckeditor. Then I have a module template where I want Full HTML, but not the editor because it generate tags on module specific code snippets. Do I have to create a new text format that's identical with the Full HTML just for this template?

gordon.waters’s picture

I took have an example where I would like to exclude the rich text editor, I have a site guestbook and I do not want CKEditor to be used for anonymous users, I can find no way if excluding the editor from this form.

Gordon

mkesicki’s picture

@gordon.waters,
set #wysiwyg attribute to FALSE for textarea for which you wish to turn off CKEditor. You can do this in drupal's hook_form_alter.

MrPeanut’s picture

Same as #17 here. Would like to have the Body field have CKEditor but our Issuu field (for use with issuu.com) not have the editor, since they are copying and pasting the embed code.

drupalnesia’s picture

Status: Closed (won't fix) » Active

I have put FB Social Plugin into block and working fine. But when I edit this block then nothing appear! Even I click to "Switch to plain text editor" still only blank textfield.

Thus removing exclude/include feature is not a good decision.

Josephnewyork’s picture

I highly agree include/exclude is needed. I have always used this in D6, and didn't expect this issue. My deadline tomorrow forced me to add this ability as a custom module.

Here is what I did for those who need this functionality as well...

I wrote a module that handles a bunch of customized functionality, especially for this kind of situation. Within this module handle excluding by field id. I do this using the fact that if a field element has #wysiwyg = FALSE within its value before the ckeditor module runs it's element_info text_format pre_render function: ckeditor_pre_render_text_format, then we can slip #wysiwyg in where needed. I opened this exclude-ability inside a hook: hook_ckeditor_excludes() so any module can handle this ability. The hook just needs to return an array of keyed bundle types, with an array value each with a list of excluded form [#id]s. And as a bonus, it also removes all CKEditors from summaries.

Add this to your custom module: (Replace 'customizations' with your module name)

/**
 * Implementation of hook_element_info_alter().
 *
 */
function customizations_element_info_alter(&$types) {
  array_unshift($types['text_format']['#pre_render'], 'customizations_pre_render_text_format');
}

/**
 * Pre rendering of textformats.
 *
 */
function customizations_pre_render_text_format($element) {
	// No CKEditor on all summaries.
	if(isset($element['summary']))
		$element['summary']['#wysiwyg'] = FALSE;
	if(!isset($element['#bundle']))
		return $element;
	// Exclude CKEditor based on field #id.
	$excludes = module_invoke_all('ckeditor_excludes');
	foreach($excludes as $bundle=>$reg_id) {
		if($bundle == $element['#bundle']) {
			$excludes = implode('|', $reg_id);
			if(preg_match("/$excludes/", $element['#id'])>-1) {
				$element['value']['#wysiwyg'] = FALSE;
			}
		}
	}
	return $element;
}

Here us where ya hook it: (I'm disabling CKEditor on the body field on my photo_gallery nodes, and comments on articles.)

/**
 * Implements hook_ckeditor_excludes().
 */
function customizations_ckeditor_excludes() {
	return array(
		'photo_gallery' => array('^edit\-body\-und\-[0-9]{1,}$'),
		'comment_node_article' => array('.*'),
	);
}

This could definitely be handled a little better, but I was in a rush, and it works fine! If the wonderful CKEditor maintainers don't want to provide the exclude/exclude, this could be added into a module to handle just this, and handled through an admin form.

Hope it helps!
-Joseph

mkesicki’s picture

@Joe Weitzel,
in Drupal 7 CKEditor shows only in fields that have input formats to which CKEditor is assigned. That is one of the biggest difference between drupal 7 & drupal 6 versions. In drupal 6 editor was assigned to user roles.
In drupal 7 you can just set your textarea field to use input format which doesn't use CKEditor. You can also set Wysiwyg attribute to FALSE as you mentioned. Writing custom module is also good idea for more experienced user. Thank you for sharing your code.

Josephnewyork’s picture

Hey @michal_cksource, yeah, I knew that was the difference between 6 and 7's CKEditor's, and I second your decision in linking it to the input formats. I think it was a smart move, and I believe this issue should be changed to a feature request instead of bug report. But, I also believe the only redeemable feature request in this issue would be to give control over whether the summary field gets a CKEditor or not. Am I wrong to think that other than my method, there is no way to remove the CKEditor from summaries? In your code (ckeditor.module:284-290), your actually writing the summary field to have the CKEditor, so I realize its something you guys planned to do, and not a bug... I think that perhaps there needs to be an option in the CKEditor profiles to choose weather or not add the editor to summaries. Thoughts?

About the exclude functionality, I'll probably create the custom module and perhaps post it on this issue one day, but I agree, its not needed in CKEditor D7. I think the only issue could perhaps be documentation. I think that it would be helpful to know the differences in 6 and 7 on the project page as people are used to using the D6 version and when they look for an hour for the exclude/include form, they freak out. Happened to me ;)

Cheers!
-Joseph

mkesicki’s picture

@Joe Weitzel ,
the main reason to remove include/exclude option was to make this more like Drupal 7 and to make performance of our module better in D7. Inlcude/exclude list was quite complex regex expresson which was fired every time when textarea field was on page . I am glad that you understand that move :)
About summarize filed we will check & consider this . But I think that summaries is different discussion for other topic...

EmersonWeb’s picture

Another use case where the visibility section is critical is conditionally loading predefined templates based on content type/ckeditor profile. For example we make heavy use of sidebars which have a predefined width and have constructed several templates specifically designed for that region.

Without being able to limit the displayed templates to the content type appropriate ones, we will then have content authors inserting any template anywhere.

Apart from dumping all the templates into a single case in the config file (which creates the issue above), is there any way to reproduce this functionality?

mkesicki’s picture

Status: Active » Closed (works as designed)

@EmersonWeb,
you can set Wysiwyg attribute to FALSE for fields that should not have CKEditor and any other Wysiwyg editor.

Dracolyte’s picture

Issue summary: View changes
Status: Closed (works as designed) » Needs review

If this is "as designed," then the design is flawed and seriously devolved. Please restore this critical functionality.

Use case: On field collections that allow multiple elements, a rich-text field serves as the caption for an image. Offer a more compact toolbar for those.