Welcome Guest, Not a member yet? Register   Sign In
Can't get Tinymce to work! please help!
#1

[eluser]Unknown[/eluser]
I'm trying to create a simple CMS with CodeIgniter. I decided to work with Tinymce for the text area's but i got some problems implementing it.

This is how it tried to set it up:

folder structure:
Code:
- public
-- css
-- js
-- images
- system
-- <all CI folders here>

I wrote this helper to point to the public folder:

Code:
function asset_url(){
    return base_url().'public/';
}


The tinymce init file:
Code:
[removed]

  tinyMCE.init({
  theme : "advanced",
  mode : "textareas",
  plugins : "imagemanager,filemanager,insertdatetime,preview,emotions,visualchars,nonbreaking",
  theme_advanced_buttons1_add: 'insertimage,insertfile',
  theme_advanced_buttons2_add: 'separator,forecolor,backcolor',
  theme_advanced_buttons3_add: 'emotions,insertdate,inserttime,preview,visualchars,nonbreaking',
  theme_advanced_disable: "styleselect,formatselect,removeformat",
  plugin_insertdate_dateFormat : "%Y-%m-%d",
  plugin_insertdate_timeFormat : "%H:%M:%S",
  theme_advanced_toolbar_align : "left",
  theme_advanced_resize_horizontal : false,
  theme_advanced_resizing : true,
  apply_source_formatting : true,
  spellchecker_languages : "+English=en",
  extended_valid_elements :"img[src|border=0|alt|title|width|height|align|name],"
  +"a[href|target|name|title],"
  +"p,"
  invalid_elements: "table,span,tr,td,tbody,font"

  });
[removed]

This is my view:

Code:
&lt;html&gt;
&lt;head&gt;
    [removed][removed]
      [removed][removed]
&lt;/head&gt;
&lt;body&gt;
    &lt;form method="post" acti&gt;
        &lt;textarea name="content" &gt;
        &lt;/textarea&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;


So right now it just shows an empty normal textarea instead of the tinymce editor. The JS files are getting loaded, no errors there.

hopefully someone can give me a clue![/code]
#2

[eluser]Unknown[/eluser]
The first thing you need to do is check if tintMCE is loaded, no error in the console is not the same as the plugin is loaded in the console, so:

try to type "typeof tinyMCE" (no quotes) in the console and see if the result is "object", if is not object the editor is not loaded and you have some problem during the rendering process, check you logic and make sure the controller is passing data to the view.

if is object it's just a config problem, you can try for example to change

Code:
mode : "textareas",

and change it to

Code:
selector: "textarea"




Theme © iAndrew 2016 - Forum software by © MyBB