Jump to content
Jennifer Stock

CKEditor custom styles

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

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

Hello, it happened exactly to me: no way to display custom styles to "body" field for 2 days, but after enabling successfully to another rich text field they appeared in body field too.

Share this post


Link to post
Share on other sites

Hello. Now it´s happening again with other field. I really don't find how to show the custom styles... It´s enabled for other fields and working. 

Share this post


Link to post
Share on other sites

Well, I found a solution, duplicate mystyles.js file (or whatever name), change the name and use it for the conflicting field.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...