Jump to content

CKEditor custom styles


Jennifer Stock
 Share

Recommended Posts

I am having trouble getting the CKEditor to include a custom style set.

I put this in the Custom EditorJS Styles Set input box for the body field (Context: None(default)):

mystyles:/site/templates/styles/mystyles.js

That file reads like this:

CKEDITOR.stylesSet.add( 'mystyles', [ 
 { name: 'Inline Codex', element: 'code' }, 
 { name: 'Inline Quotation', element: 'q' },
 { name: 'Button', element: 'a', attributes: { 'class': 'uw-btn' } },
 { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'align_left' } },
 { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'align_right' } },
 { name: 'Centered Photo', element: 'img', attributes: { 'class': 'align_center' } }, 
 { name: 'Small', element: 'small' },
 { name: 'Deleted Text', element: 'del' },
 { name: 'Inserted Text', element: 'ins' },
 { name: 'Cited Noodle Work', element: 'cite' }
] );

I've checked everything multiple times and I can't figure out what I'm doing wrong.

Thanks,

Jenn

Link to comment
Share on other sites

Hi. I just tried to add the style set to another input field that has the CKEditor enabled and it is successfully reading my custom styles. Is there something special about the "body" field vis-a-vis custom styles + CKEditor?

J


It's working now for the body field too. I guess I was experiencing a caching effect. 

Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...