As of yet I have been hesitant to use TinyMCE, as I know that most WYSIWYG editors spit out really bad code. I would like to start using TinyMCE more for the end user, but I haven’t taken that plunge yet. I would want to really learn how to fully customize it before including it - for instance, making it insert ’strong’ instead of ’b’ tags, and ’em’ instead of ’i’ tags. I’ve seen that it should allow me to customize it, add in stylesheets, allow end users to choose class styles and apply them to pieces of the page, but I haven’t started messing with it yet. Has anybody done this with any success? Do you know of any good resources I could use to get a jumpstart? Thanks in advance for your help!
"Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
It is possible to get TinyMCE to read and use your own CSS file. I did it once a long time ago, but can’t remember how it’s done.
As for <b> and <i>, it may be possible, but I think it might be easier to just write a plugin attached to OnDocFormSave using str_replace() to convert them -- something like this:
<?php
$fields = array('<b>', '</b>', '<i>' , '</i>');
$values = array('<strong>', '</strong>', '<em>', '</em>');
$output = $resource->getContent();
$output = str_replace($fields, $values, $output);
$resource->setContent($output);
Well, that is good to begin with, thanks Bob! There are single quotes missing from there, to anyone using the code.
"Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
Looks great! I only noticed cause of syntax highlighting

. That should really help out....that will cause the string replace to happen as the doc is saving, and then when TinyMCE pulls it up again, it will leave the tags as strong/em, right?
"Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
Quote from: goonz at Mar 22, 2011, 11:58 PM
Looks great! I only noticed cause of syntax highlighting
. That should really help out....that will cause the string replace to happen as the doc is saving, and then when TinyMCE pulls it up again, it will leave the tags as strong/em, right?
We can hope.
Not to start a religious argument here, but personally I prefer using <b> and <i> since they stand for bold and italic and that’s what I actually want displayed when I use them.
I hear. The original book I read to brush up when I was getting back into websites was adamantly against using any type of styling in html, according to them, it should all be done via CSS, but I’m on the fence as of now - if something should be bold, <b> makes more semantic sense than <strong> unless that passage needs to be strong as well....
"Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein