Hello fellow developers!
I have gotten FCK configured perfectly however, one last problem arises:
I've read thru the documentation and looked at some post in this forum but I am still having problems running 2 instances of FCK on one page.
I am using JavaScript on 1 Page with 1 Form and 2 Textareas, however, FCK only shows up for the text area at the bottom. Here is my code:
<p>Image at the top of the page:</p>
<p>:
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'text1' ) ;
oFCKeditor.BasePath = "../FCKeditor/" ;
oFCKeditor.ReplaceTextarea( 'text1' ) ;
}
</script>
<p> Text Below:</p>
<p>:
<script type="text/javascript">
window.onload = function()
{
var o2FCKeditor = new FCKeditor( 'text2' ) ;
o2FCKeditor.BasePath = "../FCKeditor/" ;
o2FCKeditor.ReplaceTextarea( 'text2' ) ;
}
</script>
<br>
<br>
<input type="submit" name="submit" value="Update News">
</p>
</form>
If anyone could help me out or point me to a documentation, it would be great!
Thanks
Eddy
I have gotten FCK configured perfectly however, one last problem arises:
I've read thru the documentation and looked at some post in this forum but I am still having problems running 2 instances of FCK on one page.
I am using JavaScript on 1 Page with 1 Form and 2 Textareas, however, FCK only shows up for the text area at the bottom. Here is my code:
<form method="post" action="<?php echo $PHP_SELF ?>">
<p>Image at the top of the page:</p>
<p>:
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'text1' ) ;
oFCKeditor.BasePath = "../FCKeditor/" ;
oFCKeditor.ReplaceTextarea( 'text1' ) ;
}
</script>
<textarea id= "text1" textarea name= "text1" rows="10" cols="69"><? echo $text1; ?></textarea></p>
<p> Text Below:</p>
<p>:
<script type="text/javascript">
window.onload = function()
{
var o2FCKeditor = new FCKeditor( 'text2' ) ;
o2FCKeditor.BasePath = "../FCKeditor/" ;
o2FCKeditor.ReplaceTextarea( 'text2' ) ;
}
</script>
<textarea id= "text2" textarea name= "text2" rows="10" cols="69"><? echo $text2; ?></textarea>
<br>
<br>
<input type="submit" name="submit" value="Update News">
</p>
<input type="hidden" name="newsid" value="<? echo $myrow['newsid']?>">
</form>
If anyone could help me out or point me to a documentation, it would be great!
Thanks
Eddy
RE: Multiple instances of FCK in one page!
{if $FCK}
<form action="index.php" method="post">
<input type="hidden" name="cat_id" value="{$cat_id}" />
<input type="hidden" name="mod_id" value="{$data[mod].mod_pages.mod_id}" />
<input type="hidden" name="mod_name" value="{$key}" />
<input type="hidden" name="option" value="{$option}" />
{section name=lang loop=$languages}
{$languages[lang].lang_short_name}:<br>
{$FCK}
{/section}
</form>
{/if}
my question is: how to change dinamically FCK POST fieldnames, from $_POST['FCKeditor1'] to something like $_POST['FCKeditor_1'], $_POST['FCKeditor_2']?
RE: Multiple instances of FCK in one page!
I display 2 textarea in a form like this
in my php page :
include("FCKeditor/fckeditor.php") ;
$oFCKeditor1 = new FCKeditor('FCKeditor1') ;
$oFCKeditor1->BasePath = 'FCKeditor/' ;
$oFCKeditor1->ToolbarSet = 'Mini' ;
$oFCKeditor1->Height = '100' ;
$oFCKeditor1->Width = '400' ;
$oFCKeditor2 = new FCKeditor('FCKeditor2') ;
$oFCKeditor2->BasePath = 'FCKeditor/' ;
$oFCKeditor2->ToolbarSet = 'App' ;
$oFCKeditor2->Height = '300' ;
$oFCKeditor2->Width = '400' ;
$tpl->assign_by_ref("oFCKeditor1", $oFCKeditor1);
$tpl->assign_by_ref("oFCKeditor2", $oFCKeditor2);
and in the smarty template :
<label for="head"><strong>head</strong>
</label>
{$oFCKeditor1->create()}
</p>
<p>
<label for="bloc"><strong>Bloc</strong>
</label>
{$oFCKeditor2->create()}
RE: Multiple instances of FCK in one page!
RE: Multiple instances of FCK in one page!
e.g. multiple instances
RE: Multiple instances of FCK in one page!
You are assigning two functions to the onload event, so only the last one will be called.
Join the contents of the functions and it will work.
RE: Multiple instances of FCK in one page!
for( $i = 0, $count = count( $this->smarty->_tpl_vars['languages'] ); $i < $count; $i++ )
{
$oFCKeditor[$i] = new FCKeditor( 'FCKeditor_' . $this->smarty->_tpl_vars['languages'][$i]['lang_short_name'] ) ;
$oFCKeditor[$i]->BasePath = '/FCKeditor/';
$oFCKeditor[$i]->Height = '500' ;
$FCK[$i] = $oFCKeditor[$i]->CreateHtml();
}
$this->smarty->assign( 'FCK', $FCK );
$this->smarty->assign( 'option', 'insert' );