Welcome Guest, Not a member yet? Register   Sign In
Need help with tinyMCE
#1

[eluser]Unknown[/eluser]
Hi, i want to make a textarea so i can modified it with tinymce, but all i get is a simple textarea with no feature. I dont know what im doing wrong?

My view file is:
Code:
<html>
<head>
<title>TinyMCE Test</title>
<scr+ipt language="javascript" src="&lt;?=$_SERVER['DOCUMENT_ROOT']?&gt;/blog/scripts/tinymce/jscripts/tiny_mce/tiny_mce.js" type="text/javascript">[removed]
<scr+ipt language="javascript" type="text/javascript">
tinyMCE.init({
    mode : "textareas"
});
</scr+ipt>

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

&lt;/body&gt;
&lt;/html&gt;

And my controller:
Code:
&lt;?php

class Blog extends Controller{

    function __construct(){
        parent::Controller();
    }
    function index(){//default
        $this->load->view('one_view');
    }
}

?&gt;

Than you!!
#2

[eluser]LuckyFella73[/eluser]
Your script looks fine so far - did you check the source code
(browser)? I guess there are problems with the embed path.
Seems that the tiny_mce.js is not found

For testing that, you could create a folder called "js" in your
project root, place the "tiny_mce" folder into it and call in your
header:
Code:
<scr+ipt language="javascript" type="text/javascript" src="&lt;?php echo(base_url());?&gt;js/tiny_mce/tiny_mce.js"></scr+ipt>

Don't forget to remove the "+" between "scr" and "ipt" Wink
#3

[eluser]Bramme[/eluser]
Are you sure your javascript file is correctly loaded? Try checking with firebug or smth like that.
#4

[eluser]Sarfaraz Momin[/eluser]
I had it working with almost all the features it supports.

Code:
// O2k7 skin
    var configArray = [{
        // General options
        mode : "exact",
        theme : "advanced",
        skin : "o2k7",
        skin_variant : "silver",
        plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,fullpage",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor",
        theme_advanced_buttons2 : "styleselect,formatselect,fontselect,fontsizeselect,|,code",
        theme_advanced_buttons1_add_before : "save,newdocument,separator",
        theme_advanced_buttons1_add : "fontselect,fontsizeselect",
        theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
        theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
        theme_advanced_buttons3_add_before : "tablecontrols,separator",
        theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,spellchecker,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : false,
// Example content CSS (should be your site CSS)
        content_css : "/assets/css/content.css",
        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "/assets/lists/template_list.js",
        external_link_list_url : "/assets/lists/link_list.js",
        external_image_list_url : "/assets/lists/image_list.js",
        media_external_list_url : "/assets/lists/media_list.js"
    }];
    tinyMCE.settings = configArray[0];
    tinyMCE.execCommand('mceAddControl', true, "content");

Have a good day !!!
#5

[eluser]phpoet[/eluser]
I use tinymce in my CI apps all the time. Make sure you include the tinymce/jscripts/tiny_mce/tiny_mce.js javascript file on your page. Then I use code like this:

Code:
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"
  });

Notice that I extended the valid elements to include a rel. Otherwise you won't be able to use nofollow links.
#6

[eluser]Unknown[/eluser]
It works now! it seems it wasnt loading the js, thank you all!!
#7

[eluser]Unknown[/eluser]
HI, i also have a problem with tinyMCE.
my tinyMCE has loaded properly, but there error when i click insert image or any toolbar which need to load popup.
Anyone can help me????
#8

[eluser]Milind[/eluser]
hi friends its works exactly that i want but now I have one more problem. Actually in application I have two textareas one is slandered which is tinymce that i am integrating as per your instruction and another is simple as regular that means plain text editor(textarea) but when i am insert 2nd textarea tag it display the tinymce due to 1st textarea tag that means now on my page there are two tinymce editors

please give me a guide line how to display two different texteditor on the same webpage(one is tinyeditor and anoyther is plain textarea)




Theme © iAndrew 2016 - Forum software by © MyBB