EllisLab text mark
Advanced Search
     
Problem getting TinyMCE to work together with CI
Posted: 14 August 2012 06:10 AM   [ Ignore ]
Joined: 2012-08-08
22 posts

Hi,

I want to use TinyMCE together with CI.

Earlier this morning my site was working and I don’t know what is wrong at the moment, but the textareas are no longer displayed via TinyMCE.
My Chrome Javascript Erro extension shows the error “TypeError: Object [object Object] has no method ‘tinymce’

I have a controller with following code:

$this->load->view('templates/admin/header'$header);
$this->load->view('templates/admin/styles');
$this->load->view('templates/admin/menue'$menue); 
$this->load->view('templates/admin/submenue'$menue);
$this->load->view('einsatz/createEinsatz_admin'$einsatz);
$this->load->view('einsatz/tiny_mce_inc');
$this->load->view('templates/admin/footer'); 

In the view header I have following head section

<link rel="stylesheet" href="<?=base_url('css/admin/layout.css')?>" type="text/css">
<
link rel="stylesheet" href="http://code.jquery.com/ui/1.8.22/themes/base/jquery-ui.css" type="text/css" media="all" />
  <
\script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></\script>
  <
\script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></\script>
 
<
\script language="javascript" type="text/javascript" src="<?=base_url('js/tiny_mce/tiny_mce.js')?>"></\script>
<
\script language="javascript" type="text/javascript" src="<?=base_url('js/tiny_mce/jquery.tinymce.js')?>"></\script>
 
<
\script type="text/javascript">
   $(function() 
{$("#datum").datepicker();});
</
\script

The view tiny_mce_inc consists of following

<\script type="text/javascript">
        $(function() 
{
                
$('textarea.tinymce').tinymce({
                        
// Location of TinyMCE script
                        
script_url '/js/tiny_mce/tiny_mce.js',

                        
// General options
                        
theme "advanced",
                        
plugins "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

                        
// Theme options
                        
theme_advanced_buttons1 "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,insertdate,inserttime",
                        
theme_advanced_buttons2 "hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                        
theme_advanced_buttons3 "cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
                        
theme_advanced_toolbar_location "top",
                        
theme_advanced_toolbar_align "left",
                        
theme_advanced_statusbar_location "bottom",
                        
theme_advanced_resizing true,

                        
// Example content CSS (should be your site CSS)
                        
content_css "/css/layout.css",

                        
// Drop lists for link/image/media/template dialogs
                        
template_external_list_url "lists/template_list.js",
                        
external_link_list_url "lists/link_list.js",
                        
external_image_list_url "lists/image_list.js",
                        
media_external_list_url "lists/media_list.js",

                        
// Replace values for the template plugin
                        
template_replace_values {
                                username 
"Some User",
                                
staffid "991234"
                        
}
                }
);
        
});
</
\script

And finally the view createEinsatz_admin

$einsatzGeschehen = array(
'name'  => 'einsatzgeschehen',
'id' => 'einsatzgeschehen',
'class' => 'tinymce',
'value' => set_value('einsatzgeschehen')
);
...
<
tr>
   <
td><?=form_label('Einsatzgeschehen:'$einsatzGeschehen['id']); ?></td>
   <
td><?=form_textarea($einsatzGeschehen); ?></td>
</
tr

The datepicker is working, but tinymce does not load…
Please ignore the \ in the script tags… otherwise the forum has displayed [removed]

Can anyone give me a quick hint?

KR
Habib

 
Posted: 16 August 2012 05:22 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2012-08-08
22 posts

No one got any idea?