Cannot get tinymce to render texture
Notice: This thread is very old.
- frocco
- Member | 46
Hello,
I took my exact code from another working project and applied it to nette.
$form->addTextArea('content', 'Content:')
->setAttribute('class', 'mceEditor')
->setRequired('Content is required.');
script language="javascript" type="text/javascript">
tinymce.init({
mode: "specific_textareas",
editor_selector: "mceEditor",
theme: "modern",
menubar: false,
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern"
],
toolbar1: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link ",
toolbar2: "print preview media | forecolor backcolor emoticons",
image_advtab: true,
templates: [
{ title: 'Test template 1', content: 'Test 1'},
{ title: 'Test template 2', content: 'Test 2'}
]
});
</script>
{control newsForm}
- David Matějka
- Moderator | 6445
afaik setAttribute('class', ...)
sets class to the label-input
pair container. try this instead:
->addTextArea(...)->controlPrototype->class('mceEditor')
- frocco
- Member | 46
Still no go
$form->addTextArea('content', 'Content:')
->setAttribute('id', 'content')
->controlPrototype->class('mceEditor')
->setRequired('Content is required.');
<script type="text/javascript" n:syntax="off">
tinymce.init({
tinymce.init({
mode: "specific_textareas",
editor_selector: "mceEditor",
theme: "modern",
menubar: false,
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern"
],
toolbar1: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link ",
toolbar2: "print preview media | forecolor backcolor emoticons",
image_advtab: true,
templates: [
{ title: 'Test template 1', content: 'Test 1'},
{ title: 'Test template 2', content: 'Test 2'}
]
});
</script>