CodeIgniter Forums
TinyMCE CI integration doesn't work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: TinyMCE CI integration doesn't work (/showthread.php?tid=58003)



TinyMCE CI integration doesn't work - El Forum - 05-04-2013

[eluser]alex646[/eluser]
I'm trying to add TinyMCE into my CI project, everything works well except one thing:

Editor shows up correctly, but the area where you supposed to type text is not showing up.

Just menus, toolbar and statusbar show up, actual editor to type text doesn't. I use CI's form_texarea(), TinyMCE works well if I add <textarea></textarea> right below my form_texarea(), but I get two editors, I'm very confused : (

My code:


JS files are stored in the template:

Code:
<head>
    <!--TinyMCE test -->
  
    <!-- Place inside the <head> of your HTML -->
[removed][removed]
[removed]
tinymce.init({
    mode: "textareas"
});
[removed]

Form view:

Code:
<?php echo form_open('private/add_post/newpost'); ?>

<h5>Title</h5>
<div class="">&lt;?php echo form_error('title'); ?&gt;</div>
&lt;input type="text" name="title" value ='&lt;?php print $this-&gt;session->flashdata('title'); ?&gt;' size="50" />
<h5>Post</h5>
&lt;?php echo form_error('post'); ?&gt;
&lt;?php print form_textarea( array( 'name' => 'post', 'rows' => '10', 'value' => set_value('post')) )?&gt;
<div>&lt;input type="submit" value="Submit" /&gt;&lt;/div>
&lt;?php echo form_close();?&gt;

I appreciate any help!


TinyMCE CI integration doesn't work - El Forum - 05-05-2013

[eluser]TheFuzzy0ne[/eluser]
I'd suggest you start with a simple:
Code:
&lt;?php
    $data['name'] = 'post';
    echo form_textarea($data);
?&gt;

Render the page, and make sure it works, and then add one attribute at a time to see if you can figure out where it breaks.

Try changing the name to something more random. The problem could have something to do with your CSS.


TinyMCE CI integration doesn't work - El Forum - 05-05-2013

[eluser]alex646[/eluser]
Thanks!

I've tried that, but nothing shows up when I print post var.

If I add another &lt;textarea&gt;&lt;/textarea> right after form_textarea(), two editors show up, the first one works fine, but the second one '&lt;textarea&gt;&lt;/textarea>' is broken. Somehow, when I add second textarea input, it fixes the form_textarea(). Very confusing : /