If anyone is familiar with opencart, they have several pages with ckeditor installed in the admin area, one of the areas that they have left out is where the admin can add reviews for products. I definitely want to use ckeditor for this instead of a plain textbox so that I can add pics, links, etc...
Since they have it for some areas in the admin section ckedit is already installed on the website. I figured that it would be simple to add ckedit to the textarea that I want.
this is the code for the textarea that I want to replace with ckedit.
I have tried several ways to get this to work. I tried to copy the areas from where it is already installed in the admin. The code that works in another area is:
but when I try to use that same code(replacing "description" with "text" for the name to replace)where I want it to replace the textarea in question it does not work, and firebug gives me an error:
I have also tried to add:
below my textarea:
but that does not work and tells me that ckeditor is not defined.
I would greatly appreciate any help that anyone may be able to give on this, as it is causing me a huge headache. Please let me know if I can provide anyother information.
Since they have it for some areas in the admin section ckedit is already installed on the website. I figured that it would be simple to add ckedit to the textarea that I want.
this is the code for the textarea that I want to replace with ckedit.
<tr> <td><span class="required">*</span> <?php echo $entry_text; ?></td> <td><textarea name="text" cols="60" rows="8"><?php echo $text; ?></textarea> <?php if ($error_text) { ?> <span class="error"><?php echo $error_text; ?></span> <?php } ?></td> </tr>
I have tried several ways to get this to work. I tried to copy the areas from where it is already installed in the admin. The code that works in another area is:
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script> <script type="text/javascript"><!-- <?php foreach ($languages as $language) { ?> CKEDITOR.replace('description<?php echo $language['language_id']; ?>', { filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>', filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>', filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>', filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>', filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>', filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>' }); <?php } ?> //--></script>
but when I try to use that same code(replacing "description" with "text" for the name to replace)where I want it to replace the textarea in question it does not work, and firebug gives me an error:
<b>Notice</b>: Undefined variable: languages in <b>/home/content/49/6422449/html/admin/view/template/catalog/review_form.tpl</b> on line <b>49</b><b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/content/49/6422449/html/admin/view/template/catalog/review_form.tpl</b> on line <b>49</b>
I have also tried to add:
<script type="text/javascript"> CKEDITOR.replace( 'text' ); </script>
below my textarea:
<td><textarea name="text" cols="60" rows="8"><?php echo $text; ?></textarea>
but that does not work and tells me that ckeditor is not defined.
I would greatly appreciate any help that anyone may be able to give on this, as it is causing me a huge headache. Please let me know if I can provide anyother information.
Re: help with replacing a textarea in opencart