how can i embed two fckeditors on the same page?
My project use PHP, when i initialize two fckeditors on the same page, i got javascript error/warning
First include:
the second include:
My project use PHP, when i initialize two fckeditors on the same page, i got javascript error/warning
First include:
include("editor/fckeditor.php") ;
$sBasePath = $_SERVER['PHP_SELF'];
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "/" ) )."editor/";
$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->Height = '500' ;
$oFCKeditor->BasePath = $sBasePath;
$oFCKeditor->ToolbarSet = "events";
$oFCKeditor->Value = stripslashes($content);
$oFCKeditor->Create();
the second include:
$oFCKeditor2 = new FCKeditor('content_eng') ;
$oFCKeditor2->Height = '500' ;
$oFCKeditor2->BasePath = $sBasePath;
$oFCKeditor2->ToolbarSet = "events";
$oFCKeditor2->Value = "";
$oFCKeditor2->Config["ContentLangDirection"] = 'ltr';
$oFCKeditor2->Create();

Re: Two fckeditors on the same page
Re: Two fckeditors on the same page
That would just be my guess, though... I've only used this particular editor in ColdFusion where the editors are designed by a variable called "instanceName"
in PHP, I'm assuming that you're naming it with:
$oFCKeditor = new FCKeditor('editor_name_here');
in which every new instance would just have a different name between the quotes
Re: Two fckeditors on the same page
does anyone use two fckeditors on the same page here or not?
Re: Two fckeditors on the same page
<?php define('SITE_URL','http://www.yoursite.com'); echo '<script type="text/javascript"> var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf(\''.SITE_URL.'/admin/includes/classes/fckeditor/\')) ; </script>'; $oFCKeditor = new FCKeditor(editor1); $oFCKeditor->BasePath = SITE_URL.'/admin/includes/classes/fckeditor/'; $oFCKeditor->Config['ToolbarStartExpanded'] = false ; $oFCKeditor->Config['SkinPath'] = SITE_URL.'/admin/includes/classes/fckeditor/editor/skins/office2003/'; $oFCKeditor->Value = $value; $oFCKeditor->Width = '650'; $oFCKeditor->Create(); ?> <?php define('SITE_URL','http://www.ballywhonews.com/dev'); echo '<script type="text/javascript"> var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf(\''.SITE_URL.'/admin/includes/classes/fckeditor/\')) ; </script>'; $oFCKeditor = new FCKeditor(editor2); $oFCKeditor->BasePath = SITE_URL.'/admin/includes/classes/fckeditor/'; $oFCKeditor->Config['ToolbarStartExpanded'] = false ; $oFCKeditor->Config['SkinPath'] = SITE_URL.'/admin/includes/classes/fckeditor/editor/skins/office2003/'; $oFCKeditor->Value = $value; $oFCKeditor->Width = '650'; $oFCKeditor->Create(); ?>I did mine in a function and then called that function for each textarea.
function texteditor($editor_name) { echo '<script type="text/javascript"> var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf(\''.SITE_URL.'/admin/includes/classes/fckeditor/\')) ; </script>'; $oFCKeditor = new FCKeditor($editor_name); $oFCKeditor->BasePath = SITE_URL.'/admin/includes/classes/fckeditor/'; $oFCKeditor->Config['ToolbarStartExpanded'] = false ; $oFCKeditor->Config['SkinPath'] = SITE_URL.'/admin/includes/classes/fckeditor/editor/skins/office2003/'; $oFCKeditor->Value = $value; $oFCKeditor->Width = '650'; $oFCKeditor->Create(); }and then call it in the page like so
<?php texteditor('editor1'); ?>
<?php texteditor('editor2'); ?>
Re: Two fckeditors on the same page
I will try
because what's going now it's smth interesting:
If I ignore javascript warning/error, the fckeditor doesn't pass its value by POST ;(
Re: Two fckeditors on the same page
<textarea id="page1"></textarea> <script type="text/javascript"> var fck = new FCKeditor('page1') fck.BasePath = 'FCKeditor/' fck.Width = 750 fck.Height = 500 fck.ReplaceTextarea() </script> <br> <textarea id="page2"></textarea> <script type="text/javascript"> var fck = new FCKeditor('page2') fck.BasePath = 'FCKeditor/' fck.Width = 750 fck.Height = 500 fck.ReplaceTextarea() </script>Re: Two fckeditors on the same page
Don't forget i use php version
Re: Two fckeditors on the same page
the trouvle to use 2 fckeditors on the same page was because TextFlow plugin (adds RTL support)