如何将内容设置为tinyMce进行编辑?我找不到任何方式来添加内容。
在视图中:
echo $this->TinyMCE->editor('vinagro');
echo '<textarea name="data[Article][content]" id="articleContent" class="mceSimple"></textarea>';
在bootstrap中:
Configure::write('TinyMCE.configs', array(
'vinagro' => array(
'mode' => 'textareas',
'theme' => 'advanced',
'editor_selector' => 'mceSimple',
'width' => 790,
'height' => 880,
'content' => "asdf",
'skin' => "o2k7",
'theme_advanced_toolbar_location' => "top",
'theme_advanced_buttons1' => 'fontselect,separator,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,separator,bullist,numlist,separator,link,image,separator,undo,redo',
'theme_advanced_buttons2' => '',
'theme_advanced_buttons3' => '',
//'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,wordcount,advlist,autosave'
),
));
编辑器将加载,但不加载内容。我尝试了很多方法来添加内容。但没有结果。
感谢您的帮助
答案 0 :(得分:0)
确定。我解决了
我总是尝试使用tinyMCE.activeEditor.setContent(&#34; content&#34;);准备好文件。但是这段时间没有初始化,所以我发现窗口负载并且它正常工作。
$(window).load(function(){
tinyMCE.activeEditor.setContent("content");
})