0

Trying to get a button working in content item but ckeditor won't let me.

I tried pasting in source. But when toggling back and forth bewteen source and rich text editor the html changes.

Goes from:

<button>click</button>

To

<p>click</p>

I've tried:

<p><button>click</button></p>

Not working either.

This never happened before, a settings thing?

  • 2
    You sure it is CKEditor and not your text format filters? – J. Reynolds Jan 7 '16 at 5:24
  • Just to understand: Are we talking about a site where Drupal has been upgraded (e.g. from Drupal 7 to Drupal 8)? I am referring to your This never happened before. – kiamlaluno Jan 7 '16 at 8:03
2

For FILTER HTML go to:

/admin/config/content/formats/filtered_html

add <button> to the limit allowed HTML Tags list.

enter image description here

If you use FULL HTML the button should work.

If not try

go to:

/admin/config/content/ckeditor/edit/Advanced (for Filter HTML)

/admin/config/content/ckeditor/edit/Full (for Full HTML)

Then under Advanced Content Filter, select disabled.

enter image description here

  • Doesn't work in ANY text format, no matter what settings I use – Bruno Vincent Jan 7 '16 at 7:48
  • @BrunoVincent updated my answer. – No Sssweat Jan 7 '16 at 7:57
  • It would be helpful if the OP would make clear what This never happened before. means. It seems strange that, without changing settings, the result changes, except if a module was installed/updated. If the settings were changed, they must be one of the ones listed in this answer. – kiamlaluno Jan 7 '16 at 8:07
  • Deleting a text format started this behavior. Thank you for trying to help – Bruno Vincent Jan 9 '16 at 5:03
  • @BrunoVincent that's weird, but good to hear that you solved it. – No Sssweat Jan 9 '16 at 5:13
1

U will have to change above settings, for all text format like: filtered_html, full_html. After that clear your website cache, and it will work.

/admin/config/content/formats/filtered_html

/admin/config/content/formats/full_html

  • I went and edited all formats to the settings above, one change I DID do in the past while was delete a text format, because disable doesn't disable, it deletes them, that's a bug I read about. How can I delete all text formats and reset the original ones? I think something might have gotten corrupted. – Bruno Vincent Jan 7 '16 at 10:17
0

This is Drupal bug that has been around for years, not even fixed in Drupal 8.

I deleted a text format, disable = delete, not disable, only way to get it back is through PHPmy admin and set to true and false...

Solution:

DON'T TOUCH TEXT FORMATS!

Anybody correct me if I'm wrong, but that's the conclusion I came to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.