Forum closed. New forum available at http://community.wymeditor.org/

Using an external css file for content

Support forum for WYMeditor.

Using an external css file for content

Postby smarques on Thu Dec 18, 2008 10:11 am

Hi. I am trying to use wym in a simple cms system I am working on.
Here's my problem, I apologize if its a stupid question, but just couldn't figure it out... actually its 2 questions :-)

1)
I would like to give the user a visual feel on what the content will look when published... so It would be useful to apply a custom css to the content area. One that I could pass as a parameter and would be loaded as an additional css for the iframe, overriding the css provided by the skin system... This way I could i.e. easily set the background color to the color I use in the public web site, have h1's formatted in the same way, and so on.
Is there a simple way to do this?

2) I am trying to add custom buttons in the tools, but making it configurable at application level, so that in some config files of my application I could have a list of extra buttons I want to appear in the toolbar. This works fine using the option object when initializing the editor, my problem is how to set the icon for the button. I can pass a style for the button and set a background image to it... but in what stylesheet should I add the style definition for that icon?
Now if I could have a custom css files as per question 1, my choice would be to define that style there as well.
It would not make so much sense to me to add it in the skin css becouse I want the user to be able to add buttons in a simple way, without having to mess with the skins...

Thanks for your patience and help.
sergio
smarques
 
Posts: 2
Joined: Thu Jul 10, 2008 12:45 pm

Re: Using an external css file for content

Postby jfh on Tue Jan 06, 2009 8:13 pm

1) This sounds like WYSIWYG and should be avoided. BTW there's no configuration option available.
I guess the easier way would be to add the stylesheet call in wymiframe.html.
You can also dynamically add CSS rules via JS, that will be applied to the iframe.
Example available at
http://files.wymeditor.org/wymeditor/tr ... ditor.html
(see wym.addCssRules)

2) http://files.wymeditor.org/wymeditor/tr ... utton.html should help.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest