Jump to content

adding div element attribute to mystyles.js can not be used (vanishes after save)


Smirftsch
 Share

Recommended Posts

I've got some odd problem adding additional styles to mystyles.js. After reading some and following the article here: https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/modules/Inputfield/InputfieldCKEditor/README.md#custom-editor-js-styles-set

I was able to add a custom style. So far so good 😉

It is displayed in the Styles menu and can be selected there. Now the odd thing starts, if I add a custom style like this:
 

...

 { name: 'Box Top', element: 'span',attributes: { 'class': 'box_top' } },
 { name: 'Box Bottom', element: 'span', attributes: { 'class': 'box_bottom' } }

 

it works and can be selected just fine.

However, if I add this:

 { name: 'Box Top', element: 'div',attributes: { 'class': 'box_top' } },
 { name: 'Box Bottom', element: 'div', attributes: { 'class': 'box_bottom' } }

It is also displayed, can be selected - BUT - once the edit is saved, it is gone, won't be displayed in the page and won't be shown anymore in the editor as selected style, it goes back to "normal".

 

Can anyone give me a hint what I missed?

Link to comment
Share on other sites

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

×
×
  • Create New...