How do I show the WYSIWYG editor to describe a product in magento 1.7 without having it pop up?

I am trying to change the product description of magento 1.7 to show the default WYSIWYG editor without clicking the "WYSIWYG editor" button, but they could not find the code to edit, can anyone give some advice here?

+6
source share
3 answers

I am sure Magento admin has an option:

Admin β†’ System β†’ Configuration β†’ Content Management

+1
source

I believe Andrew's answer should be correct. Magento forms should check if WYSIWYG is allowed.

Mage::getSingleton('cms/wysiwyg_config')->isEnabled() 

This is just a check of the setting you are changing with a previously posted answer:

Admin β†’ System β†’ Configuration β†’ Content Management

This will by default show a good interface, rather than force a popup or action to enable it.

0
source

The answer to this question was originally posted here by Nikitas : fooobar.com/questions/925546 / ...

I copy the answer here for simplicity ...


After a little research, I found it.

1) Put this code in the .phtml file that you want the editor to display directly.

2) In the sixth line of code, you can see elements: "short_description" . You can change the "short_description" with the identifier of the element you want. You can add multiple item identifiers, separated by commas and without spaces.

Example: I put this code in app/design/adminhtml/default/default/template/catalog/product/edit.phtml because I want the editor to appear directly when I edit the product 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> 
0
source

Source: https://habr.com/ru/post/925544/


All Articles