hi all,
i want to ask how the way if i want to adding a new style sheet to select box on tiny mce ?
thx.
-
☆ A M B ☆
- 24,524 Posts
I did some looking around, and you can assign a style sheet to TinyMCE in the site Configuration, in the Interface & Features tab. In the field Path to CSS, put something like /assets/templates/mytemplate/style.css - this needs to be from the root of your web space. For example, for my localhost development installation, I used /modx/assets/templates/andreas03.css.
This will automatically populate the styles drop-down with all of the class designators in your css file.
You may need to add some instructions to your .css file to compensate for the fact that the editor window does not contain all of the structure of your site template, such as wrapper divs.
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_css#TinyMCE_specific_rules
I can use that method ok, but thank you for your reply anyway.
The problem I am having is with the "Path to CSS file" option. If I add my style sheet in here, I was under the impression from manuals and other posts that the core styles from that style sheet should be added to the editor. But it doesn’t seem to work. I am pretty sure I am not getting the path wrong, as the background colour/image of my site suddenly becomes the background colour/image of the editor window, so it’s picking the body style up somehow. But where am I supposed to see the rest of the styles for selection? I thought it’s supposed to be in the Styles drop-down list?
The only successful way I ever found to accomplish this was exactly how cbaone described - create a seperate style sheet specifically for the editor, although only classes worked - not #ids, if I remember correctly.
Then just add the relative path into the css path field in the manager and it should work.
ex: assets/templates/your_template/editor.css