Magento add wysiwyg to custom frontend form -
i'm writing module, , i'm searching how add build-in wysiwyg editor textarea in frontend. possible? knows, how implement that?
so, keeping final solution in case need :
1) put code in .phtml file want editor appear directly.
2) in 6th line of code can see elements: "short_description"
. can change "short_description"
element id want. can add more 1 element id separated comma , without spaces.
example: put code in app/design/adminhtml/default/default/template/catalog/product/edit.phtml
because want editor appear directly when edit product's description, short description etc.
the code:
<script type="text/javascript"> window.onload=function() { tinymce.init({ mode : "exact", elements: "short_description", theme : "advanced", plugins : "inlinepopups,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,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", 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]", theme_advanced_resize_horizontal : 'true', theme_advanced_resizing : 'true', apply_source_formatting : 'true', convert_urls : 'false', force_br_newlines : 'true', doctype : '<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">' }); }; </script>
Comments
Post a Comment