5

I'm working through my first major Drupal 7 implementation. My users need to create nested HTML ordered lists, with the various styling in Roman, numeric and alpha formats as listed at http://www.w3.org/TR/html401/struct/lists.html#type-values . The current project is taking place on a node of content type "book page."

This install is using CKeditor, which properly shows the various format types in edit mode.

In node view mode, though, the styles disappear, reverting to 1,2,3 format. I found in the Filtered HTML settings the statement "... and CSS are always stripped." Since CKeditor applies style commands to create the formatting method, it seems that Drupal filters them out.

Is there a method to allow styling in node view? I just discovered http://drupal.org/project/css_injector but can't yet determine if it will do what I need.


Found this discussion which appears to be related. http://drupal.org/node/259527

3

I recommend using the WYSIWYG Filter module. In the "HTML elements and attributes" textarea there is a list of allowed HTML tags. 'ol' should be present. If it is, add '[class|style]' to it which will make it look like this:

ol[class|style]

Or, you can add @[class|style] to the list to enable the style and class attributes on all allowed html tags.

-3

You can allow html tags on admin/config/content/formats/filtered_htmlenter image description here

  • 1
    This doesn't really address the original asker's situation. – texas-bronius Jun 18 '15 at 22:10
  • 1
    @texas-bronius Nope. You should vote stuff like this down so it either gets deleted/edited or people know it's a bad answer. For OP: Style isn't a tag, it's an attribute. And, by design, it's stripped out. (I'm not saying I agree with why it is, just that it is.) As far as I know, there's no way to do it without some kind of contrib module/custom code. – UnsettlingTrend Jan 28 '16 at 15:34

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.