[eluser]Michal1[/eluser]
Hello,
I have been trying to integrate tinymce wysiwyg into all textareas on my website, but I still cannot figure out why it does not work. I read all post about tinymce on this forum and have followed all steps.
I created a file default.js in js folder where tinymce is located and inside this file I have
Code: <?php
function initMCE() {
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
//plugins : "style,table,advimage,advlink,emotions,iespell,preview,media,contextmenu,paste,directionality,noneditable,advlist",
plugins : "table,preview",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,link,unlink,image,|,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,|,sub,sup",
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/content.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",
});
?>
Then in my view where I have textareas I have:
Code: <html>
<head>
< script type="text/javascript" src="<?php echo base_url()?>js/tiny_mce/tiny_mce.js" >< /script>
< script type="text/javascript" src="<?php echo base_url()?>js/default.js">< /script >
< script language="Javascript" >
initMCE();
< /script >
</head>
<body>
<H2> Write an article </H2>
<?php echo form_open('administrace/create_article'); ?>
<p> <label for= "title"> Title: </label>
<input type="text" name="title"" id="title"" size="40">
</p>
<p>
<label for = "content"> Content: </label>
<textarea rows="20" cols="80" name="content" > </textarea>
</p>
<p>
<input type="submit" value="Add content"/>
<php echo form_close(); ?>
</body>
</html>
But when I reload my page the tinymce is still not there. Anyone has any idea why?
Thank you very much
[eluser]cideveloper[/eluser]
First thing I would do is move all your javascript calls to the bottom of your page above the closing body tag like below.
Code: <php echo form_close(); ?>
< script type="text/javascript" src="<?php echo base_url()?>js/tiny_mce/tiny_mce.js" >< /script>
< script type="text/javascript" src="<?php echo base_url()?>js/default.js">< /script >
< script language="Javascript" >
initMCE();
< /script >
</body>
</html>
Secondly, why does your javascript file default.js have php open and close tags.
[eluser]Michal1[/eluser]
Hi sorry for <?php in default.js That was a mistake and of course I do not have those tags inside.
I have moved script above the ending body tag but it wysiwyg still does not show :/ Do not really see where is the problem.
[eluser]Michal1[/eluser]
Btw, just to be sure. I am sending an attachment, where you can see how my folders look like.
[eluser]Michal1[/eluser]
Just thinking, could there be a problem with htaccess? I have not created any so...
[eluser]Unknown[/eluser]
Попробуй поправить htaccess, считаю что проблема в нем, либо в самомо интеграторе.
[eluser]Michal1[/eluser]
I am sorry I do not speak Russian...
[eluser]Mutsop[/eluser]
Just to be sure
when you have your webpage in front of you and check the source, what does the head links (.js path) say?
[eluser]Michal1[/eluser]
Hi Mutstop: this is my head in source view
Code: < head>
< script type="text/javascript" src="http://127.0.0.1:8888/novy_projekt/js/tiny_mce/tiny_mce.js">< /script >
< script type="text/javascript" src="http://127.0.0.1:8888/novy_projekt/js/default.js" >< /script >
< script language="Javascript" >
initMCE();
< /script >
< /head>
[eluser]cideveloper[/eluser]
Can you try this.
Code: <php echo form_close(); ?>
< script type="text/javascript" src="<?php echo base_url()?>js/tiny_mce/tiny_mce.js" >< /script>
< script type="text/javascript" src="<?php echo base_url()?>js/default.js">< /script >
< script language="Javascript" >
tinyMCE.init({
mode : "textareas",
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,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
});
< /script >
</body>
</html>
|