Some basic questions

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 5, 2010   (RSS)

Re: [fleff] Some basic questions

By Chris - January 25, 2010

Hi Farnham,

2. I don't believe there's any way to modify the options in the fontsizeselect dropdown, but you could use the styleselect dropdown instead. You can supply your own CSS styles (including specific font pixel sizes) in cmsAdmin/lib/wysiwyg.css (see .exampleClass in that file) and they'll appear in a dropdown for your user. To enable styleselect, modifying a line in cmsAdmin/lib/wysiwyg.php. Change this line:

theme_advanced_buttons1 : "formatselect,fontsizeselect,bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,outdent,indent,|,removeformat,fullscreen",

to this: (new code in red)

theme_advanced_buttons1 : "formatselect,styleselect,fontsizeselect,bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,outdent,indent,|,removeformat,fullscreen",

Depending on how your client needs to generate content, this may solve your problem #1 as well. If not...

1. You can add a font dropdown to TinyMCE by modifying a line in cmsAdmin/lib/wysiwyg.php. Change this line:

theme_advanced_buttons1 : "formatselect,fontsizeselect,bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,outdent,indent,|,removeformat,fullscreen",

to this: (new code in red)

theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect,bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,outdent,indent,|,removeformat,fullscreen",

3. This is a tricky problem. One solution might be to wrap your wysiwyg output in your viewers with a classed div, then you can supply a CSS rule which targets only <P> tags in wysiwygs. For example:

<style>
.wysiwyg_content P { margin: 0; }
</style>
<div class="wysiwyg_content"><?php echo $record['content'] ?></div>

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Some basic questions

By fleff - January 25, 2010

Thanks, Chris, for your usual prompt response. It looks as though the wysiwyg.php additions will work beautifully and I'll give the <p> tag workaround a try. I'll let you know how things go.

Best to all,

Farnham

Re: [fleff] Some basic questions

By fleff - February 5, 2010

The wysiwyg.php additions work just fine and I don't understand why you don't offer the font-family menu as a regular feature in the wysiwyg field. Thanks again for sending it along. CMSB is great!

Farnham