[thelist] SPAW Editor - Unable to show CSS styles in editor

Tim Burgan email at timburgan.com
Fri Jan 21 21:43:13 CST 2005


Hello,

I'm trying to implement the SPAW Editor with some difficulties.

My site uses CSS to style the content, so I've created a seperate 
stylesheet for SPAW reflecting these styles so that they can be selected 
in the editor.. and display styled content in the editor.

My styles are only applied to the body and to headings 2 - 5. (eg. body, 
h2, h3, etc).

Sorry about the long message... I'm really suck, but so close.

Am I doing this correctly.. here's my PHP:

/*****************************
Display SPAW PHP WYSIWYG editor.
*****************************/

/* Determine the physical root of the website */
if ( !ereg('/$', $HTTP_SERVER_VARS['DOCUMENT_ROOT']) )
   $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'].'/';
else
   $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
define('DR', $_root);
unset($_root);

/* The physical path were SPAW control resides. */
$spaw_root = DR .'spaw/';

/* Include the SPAW control file */
include $spaw_root .'spaw_control.class.php';

/* Here we add some styles to styles dropdown */
$spaw_dropdown_data['style']['default'] = 'No styles';
$spaw_dropdown_data['style']['h3'] = 'Heading 3';
$spaw_dropdown_data['style']['h4'] = 'Heading 4';
$spaw_dropdown_data['style']['h5'] = 'Heading 5';
           
 /** Display the editor **/
 $spaw_content_in = $rs_body->value;
 $sw = new SPAW_Wysiwyg('spaw2' /*name*/,
                                   stripslashes($spaw_content_in) /*value*/,
                                   'en' /*language*/,
                                   'sidetable' /*toolbar mode*/,
                                   'default' /*theme*/,
                                   '100%' /*width*/,
                                   '268px' /*height*/,
                                   '' /*stylesheet*/ ); // this defaults 
to WYSIWYG.css - the editors default file
$sw->show();


My CSS file is:

body, tr,td, table {
    color: #000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10pt;
}

h2, h3, h4, .h2, .h3, .h4  {
   font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}

h2, .h2 {
   font-size: 1.8em;
   color: #4F2591;
   padding-left: 27px;
   background: url(images/asterix.gif) no-repeat;
   background-position: 4px;
}
        
h3, .h3 {
  font-size: 1.6em;
  color: #FF7200;
  padding-top: 5px;
  /* border-top: dotted 1px #4F2591; */
}
        
h4, .h4 {
  color: #4F2591;
  font-size: 1.4em;
  margin-top: 1.5em;
}

h5, .h5 {
  color: #FF7200;
  font-size: 1.1em;
  font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
}

img {
  border: 0px none;
}

hr {
  color: #DDD;
}
        
tr {
   padding-bottom: .75em;
}

.h2, .h3, .h4, .h5 {
   font-weight: bold;
}


Thanks for your time

Tim




More information about the thelist mailing list