我想要的是將TinyMce wysiwyg編輯器插入到前端。目前我所擁有的是:在按鈕上單擊ajax請求的首頁使用tinymce.init腳本加載textarea。 tiny_mce.js文件被加載到頭部。當我打開可編輯的textarea,我能夠寫東西,但我在html結構是什麼樣的Magento。正確插入wysiwyg
false> false> false> false> false> false> false> false> false> false> false> false > false> false> false> false> false> false> false> false> false> false> false> false> false> false> false>等等等等。
更新1
的問題是:我需要所見即所得的前端。我在前端添加了tiny_mce.js,並運行init。但爲什麼它不能正常工作。按鈕不起作用,如果我輸入文本,則不會創建html。所以我總是在html節點中得到錯誤的false false。
UPDATE 2 我目前的tinymce配置如下。我能夠顯示所見即所得的編輯器窗口。此外,我可以得到上傳窗口,沒有magento的文件選擇。
<script language="javascript" type="text/javascript">
//NB: the single quotes for the doctype param must be backslashed; wiki format is removing them.
// Event.observe(window, 'load', function() {
tinyMCE.init({
mode : "exact",
theme : "advanced",
strict_loading_mode : true,
elements : "block_content",
plugins : "preview,media,iespell,insertdatetime,advimage,advlink,emotions,table,save,advhr,style,layer,inlinepopups,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
theme_advanced_buttons1 : "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,|,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,|,visualchars,nonbreaking",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
theme_advanced_resize_horizontal : "true",
theme_advanced_resizing : "true",
apply_source_formatting : "true",
convert_urls : "false",
doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
force_p_newlines : 'false',
force_br_newlines : 'true',
forced_root_block : 'false', //btw, I still get <p> tags if this is false
remove_trailing_nbsp : 'false',
verify_html : false,
extended_valid_elements : "a[name|href|target|title|onclick],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],tr"
});
// });
</script>
對不起,我不明白你的問題在這裏 – Thariama 2012-01-17 16:16:10
檢查更新 – 2012-01-18 06:34:51