CodeIgniter Forums

Full Version: tinymce
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]tirso[/eluser]
hi to all

Actually I search all over the forums about tinymce. I have tried so many times but it doesn't work. It just only display a plain textbox with save button. I downloaded the tinymce "tinymce_3_2_5.zip" the main package. I put it in my js folder.

Any help would greatly appreciated.

thanks

Tirso

directory structure
js
js/tiny_mce
system


in my view "newpost.php"

Code:
<html>
<head>
<title>TinyMCE Test</title>
[removed][removed]
[removed]
tinyMCE.init({
    mode : "specific_textareas",
    theme : "advanced",
    plugins : "paste,preview",
        theme_advanced_buttons1 : "bold,italic,underline,separator,bullist,numlist,undo,redo,link,unlink,separator,paste,pastetext,pasteword,separator,cleanup,preview,code",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        extended_valid_elements : "a[name|href|target|title|onclick|rel],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
      editor_selector : "mceEditor"
  });
[removed]

</head>
<body>
<form method="post" action="localhost">
<textarea name="content" cols="50" rows="15"></textarea>
<input type="submit" value="Save" />
</form>

</body>
</html>

in my controller

Code:
function newpost(){
    $data['page'] = 'admin/blog/newpost';                        
    $this->load->view('template_admin',$data);    
}

El Forum

[eluser]jdfwarrior[/eluser]
Yeah TinyMCE was kind of a pain in the butt the last time I tried to mess with it as well. I had to play with a little while to get it to work right.

Would you like me to try to get it working again and let you know what I did?

El Forum

[eluser]tirso[/eluser]
hi jdfwarrior,

Thanks for your immediate replied. Sure, I am waiting for your solutions.

Thanks

tirso

El Forum

[eluser]jdfwarrior[/eluser]
I actually got it working really fast this time, but just a minimal config. I started small just to make sure that it would work. Are you running on localhost? Are you certain that the tiny_mce file is being loaded?

All I did was.. from a clean, base installation of CodeIgniter..

1. Made sure the home page worked
2. Made controller
3. Made view
4. Copied tiny_mce folder (not whole structure that comes in the zip, just the tiny_mce folder thats about 3 levels down) to my public/js folder that I made off of the root of the site.
5. Loaded the js file in the view using

Code:
script type="text/javascript" src="<?=base_url()?>/public/js/tiny_mce/tiny_mce.js"

6. Took one of the examples from the tinymce site and made my script.
7. Tried. Initially failed. Checked source, clicked link in source to see if tiny_mce actually loaded, it had not because I forgot to set the base_url variable in the config (as i said, brand new CI install). I set the base_url variable to http://localhost, the refreshed.
8. Success.

Hope this helps

El Forum

[eluser]tirso[/eluser]
hi,

thank you so much. it's now working like a charm


thanks

tirso

El Forum

[eluser]jdfwarrior[/eluser]
What turned out being your problem?