wysiwyg limitations

9 posts by 4 authors in: Forums > CMS Builder
Last Post: March 17, 2009   (RSS)

By Berkowitz - April 8, 2008

Hi,

I have a question about the wysiwyg boxes. Is it possible to limite the width and height of the boxes.
An example: When people create a new news event in my cms it will be shown in a Frame. That frame has a width and a height. I want to limite people to those 2 so I don't get scrollbars in my frame. Is this possible?

Thanks in advance
Berkowitz

Re: [Dave] wysiwyg limitations

By Berkowitz - April 10, 2008

Thanks Dave,

I knew the height could be set but it's more the width that's giving me troubles. I just hate horizontal scrollbars [tongue].
i wanted to limite the width if people work with tables in cms. But oh well. I have 2 other questions now [tongue] but will open seperate topics for them as they don't have anything to do width this or eachother.

thanks,
Berkowitz

Re: [Berkowitz] wysiwyg limitations

By Dave - April 10, 2008

I could show you how to edit the code to do it if you're comfortable editing PHP and Javascript. It's in /lib/menus/default/edit_functions.php (search for tinyMCE.init). You can just add this to the options:

width: 200,

The problem is the buttons force it wider, so you'd have to change all those as well and you only get 3 rows to work with.

If you wanted to hardcode it to use one wysiwyg init for one field and another for another field you could do that with this code:

if ($tableName == 'yourTableName' && $name == 'yourFieldName') {

print <<<__HTML__
<script language="javascript" type="text/javascript"><!--
tinyMCE.init({
width: 200,
... wysiwyg options here ...
});
//--></script>
__HTML__;

}
else {

print <<<__HTML__
<script language="javascript" type="text/javascript"><!--
tinyMCE.init({
... wysiwyg options here (don't specify width for default width) ...
});
//--></script>
__HTML__;

}


I realize that's a little complicated, but if you really wanted to constrain the width that would be one method. Be sure to backup the file first before you make any changes!

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

Re: [Dave] wysiwyg limitations

By ricrogram - March 16, 2009

Hi Dave,

I'm trying to set the width of the wysiwyg editor panel CMS Builder). I want the view in the editor to best reflect how it will look in the site. The tool buttons pushing it wider than I want it is not a problem as I need it wider anyway.

I thought I had found the answer with this post however the code you mention in edit_functions.php is not there anymore. Are you able to let me know how to set the width for the wysiwyg editor. I don't know any php as such although I have managed to change a few small things (remove/add wysiwyg tools etc) which have worked out really well.

Cheers,
Richard

Re: [ricrogram] wysiwyg limitations

By ross - March 17, 2009

Hi Richard

Thanks for posting!

One quick thing here, have you tried using the editor in full screen mode. There will be a button in the second row, over on the right that lets you toggle that on and off.

It basically makes the editor full screen so you have plenty of room to work with.

Let me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ricrogram] wysiwyg limitations

By Dave - March 17, 2009

Hi Richard,

The wysiwyg configuration data is now stored in cmsAdmin/lib/wysiwyg.php

And you can find all kinds of docs for customizing the wysiwyg here: http://wiki.moxiecode.com/index.php/TinyMCE:Index

I haven't played with it lately but it looks like this is the width option: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/width

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

Re: [ross] wysiwyg limitations

By ricrogram - March 17, 2009

Thanks Ross,

I was really after something that would make the content area exactly the same width as it appears in the site. Looks like Dave may have come up with something.

Thanks again for your help... much appreciated.

Re: [Dave] wysiwyg limitations

By ricrogram - March 17, 2009

Thanks Dave,

This is exactly what I was after. I now have the content area of the wysiwyg editor exactly the same width as the table where the content goes on the site.

I have to say that the support for this software is unbelievable... matched only by how good the software itself is. This is by far the best and most useful software package I've bought off the internet. As a web designer with very limited coding ability I'm amazed how simple yet powerful it is.

Cheers,
Richard