Use case:
I just drop an atom (image) from the library in my ckeditor text area.
I would like to right align this image without having the text at the left of it:
.dnd-atom-wrapper{
float: right;
margin-left: 100%;
}But I would like to have this behaviour ONLY for this image.
Thus, it would be nice to have the opportunity to add a class and/or style definition in the atom property dialog.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | additional-css-classes-on-advanced-tab-2512728-9.patch | 3.17 KB | nagy.balint |
Comments
Comment #1
nagy.balint commentedUsually the atom properties dialog is handled by content editors. So it is maybe not the best to simply include a textbox to define additional css classes in that dialog.
I have the following ideas:
- An extra select option which would define whether to have a clear after the float for each type of alignment.
- Or simply to add an atom specific class to the wrapper automatically, like scald-atom-156 so the atom with the sid 156 would have that class. Then css rules could be defined for that single atom. However maybe the issue is in this case that then each time such a behavior is needed you would need to specify rules for it.
Comment #2
gifad commentedHow to implement
Sample (real) code to implement a framing option :
Two steps :
1 - Override atomProperties.js, or inject definition (like scald_image.module do)
2 - override the theme function :
finally, write the corresponding css rules...
Now, should scald core implement a generic "Additional classes" textfield to the standard atomProperties dialog ?
Comment #3
nagy.balint commentedI think additional classes should not be on a dialog that is meant for content editors and not for site builders.
However we can consider this extra option.
Comment #4
nagy.balint commented@gifad : can you describe what 'Line' and 'Frame' means in this context?
Comment #5
gifad commented@nagy.balint :
NB: there is actually a "CSS class" textfield in the "Advanced" tab of the CKEditor image plugin, which is (or at least was) targeted to the end user;
In the new image2 plugin, though, those "advanced options" have disappeared - the official word from CKEditor team is : "We provide only basic, simple options, and allow site builders to easily develop specific options, targeted to their users..."
Now it depends on how you define "easy"...
Comment #6
dunebl@gifad
Many thanks for your example...
But I have to say that I don't understand what to do exactly...
@nagy.balint
I don't agree with you: If a textbox exists for adding class and/or style name, this will not add complexity for the content editor. If he/she doesn't understand how to use it, he/she will not use it... Maybe after some time he/she will do some progress and will start to play with it. Another example is the CKEditor create table button which also contains several textbox to add class name or style (and even ID) in the advanced tab of the "table property" dialog.
Thus, creating an advanced tab for the "Atom property" dialog would be a way to hide the complexity for the starter editor.
Comment #7
nagy.balint commentedWell an advanced tab could be a good idea as well.
@jcisio what do you think?
Comment #8
jcisio commentedYes an advanced tab is a nice idea.
Comment #9
nagy.balint commentedBased on @gifad 's approach, here is a patch which will add a new tab besides the main tab, where the user can fill in css classes. The classes are stored in the options since there is no other way to get the information to the widget embed function.
Also the functionality will only work with the dndck4 plugin with the widgets.
Comment #11
nagy.balint commentedThanks, Committed.
Comment #13
scotwith1tWhat would the proper way be to HIDE this tab if we want to? I would like to customize the dialog box and hiding this tab is one of the things the client has requested. I know it's fairly simple, but seems to be completely different from before with the sas syntax. Any tips on customizing the dialog box behavior?
Comment #14
gifad commentedscotself : try this hack :
Comment #15
scotwith1tThanks gifad. I actually figured it out. Similar, for sure but uses a little more of the CKEditor's functions. First, in:
So my dnd-enabled widgets have a class on them, which is helpful for:
Hope that helps someone. :)