Hi,
Does anyone know if its possible to create a few image classes in CSS then assign them in the tinyMCE image upload?
Basically i can add the css in the lines of each image i upload but i’m thinking to make it easier for my users it owuld be easier if they could just select a class from a drop down list i.e alignleft or alignright.?
thanks
-
MODX Staff
- 2,502 Posts
Unfortunately TinyMCE does this poorly. What I have done in the past is one of two things. I have either used a plugin to change the align="left" to a class="left" or another way to do it is to create a custom user.css file that only contains rules specifically for use with TinyMCE in the user styles dropdown. Create a simple stylesheet with the rules, config TinyMCE to use it in Tools->Config->Interface&Features: Path to CSS file.
This is the easier of the two methods I have used but I am sure there are several other approaches to handle this.
You can only use classes and they should be simple rules like:
.left{
float:left;
margin:0 20px 20px 0;
}
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
The second method worked perfect... thanks!