wanna make custom style on editor (e.g. background etc)? do these! (work on my php page )
1. in fckeditor.php add line like this
function FCKeditor()
{
$this->ToolbarSet = '' ;
$this->Value = '' ;
$this->CanUpload = 'none' ;
$this->CanBrowse = 'none' ;
$this->style = '';
}
function CreateFCKeditor($instanceName, $width, $height)
...
...
if ( $this->style != '' )
$sLink = $sLink . "&CSSurl=$this->style" ;
2. in fck_config.js changes
config.EditorAreaCSS = config.BasePath + 'css/fck_editorarea.css' ;
to
config.EditorAreaCSS = config.BasePath + 'css/' ;
config.CSSdefault = 'fck_editorarea.css' ;
or you can make fckeditor.config.js in your root directory and write those two lines above
3. in fck_editor.js make some changes in function initEditor()
...
if (! bDataLoaded && ! objContent.Busy)
{
bDataLoaded = true ;
if (! URLParams["CSSurl"]){
sCSSurl = config.EditorAreaCSS + config.CSSdefault ;
}else{
sCSSurl = config.EditorAreaCSS + (URLParams["CSSurl"]);
}
objContent.DOM.body.onpaste = onPaste ;
objContent.DOM.createStyleSheet(sCSSurl) ;
setLinkedField() ;
}
...
4. write your own stylesheet, and then place it under 'css' directory. for example i made stylesheet called black.css with these value :
body, td, tr, p {
background: #000000;
color: #ffffff;
}
5. call it when you create the editor
$oFCKeditor = new FCKeditor ;
$oFCKeditor->style = 'black.css' ;
$oFCKeditor->Value = $content ;
$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 450 ) ;
that's it!! hope work on yours
Tue, 07/29/2003 - 23:19
#1