CMSB WYSIWYG

11 posts by 6 authors in: Forums > CMS Builder
Last Post: February 5, 2009   (RSS)

By richb - December 12, 2008

Is there a way to change/add HTML sytles for fonts? Currently it supports, Paragraph, Heading1, Heading2, etc. I have external style sheet that I would like for it to support. How can I add new styles?

Re: [richb] CMSB WYSIWYG

By flamerz - December 12, 2008 - edited: December 12, 2008

Maybe this is useful:

http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_blockformats

I hope it helps.

You can redefine every <h1>, <h2>, ... for your own purposes in your css class, better than make "hacking" on TinyMCE.

Re: [richb] CMSB WYSIWYG

By Dave - December 14, 2008

You can add custom styles like this:

Edit /lib/wysiwyg.php

Search for "theme_advanced_buttons1". That line specifies which buttons to display. You can find a complete button list here: http://wiki.moxiecode.com/index.php/TinyMCE:Control_reference

Remove the "formatselect, fontsizeselect" buttons and replace with "styleselect". This will use a pulldown of style classes instead of the format and font size pulldowns. Like this:

theme_advanced_buttons1 : "styleselect, bold, (... your buttons here ...), fullscreen",

Then just add the classes you want available to this file: /css/wysiwyg.css

Next, make sure your viewer pages also load a .css file that has the same classes in it. Something like this:

<link rel="stylesheet" type="text/css" href="css/style.css" />

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMSB WYSIWYG

Hi Dave,

In the notes for a previous version of the instructions above you added the comment:

"In your .CSS file, add the following styles or the editor will not function in some browsers."

body.mceContentBody {
background:#FFFFFF;
}

body.mceContentBody, .mceContentBody td, .mceContentBody pre {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}

Is something like this still necessary?

thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] CMSB WYSIWYG

By Dave - December 15, 2008

Hi Jerry,

Those are for the /css/wysiwyg.css file only. They set the default styles for the wysiwyg editor. They are set by default in /css/wysiwyg.css so you don't need to add them unless you want the change the font or style that appears in the wysiwyg for unformatted text.

I don't recall the wysiwyg not functioning without them, but certainly you'd get a different font face and size. Probably Times New Romain (browser default) and a large font).

Hope that helps! Let me know if you have any other questions about that.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMSB WYSIWYG

OK, I get it. It probably referred to an older version of the editor and (much) older browsers.

Thanks
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Toledoh] CMSB WYSIWYG

By Dave - February 4, 2009

Hi Tim,

First try clearing your browsers cache, it could be caching the old file. Next can you post an url to (or attach) your wysiwyg.css file from: cmsAdmin/css/wysiwyg.css and we can take a look and see if we can spot any problems.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMSB WYSIWYG

By Toledoh - February 4, 2009

Hi Dave,

Thanks for helping!

Cleared cache... tried various browsers... gotta be something silly...[:/]

http://wineclubnetau.ozstaging.com/cmsAdmin/css/wysiwyg.css

Cheers,
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] CMSB WYSIWYG

By aev - February 5, 2009

Hi Tim!

Have you remembered to add the wysiwyg.css to your HTML?

Put something like this into the HTML > HEAD section of your site:
<link rel="stylesheet" type="text/css" href="/cmsAdmin/css/wysiwyg.css"/>

Also remember to have a backup of this file when upgrading CMSBuilder, so you don't lose your custom css.

-aev-