Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here are a few simple steps that will help you make TinyMCE work with Magento CMS pages.</p> <p><h2>Step 1.</h2> <a href="http://tinymce.moxiecode.com/download.php" rel="nofollow noreferrer">Download</a> and unpack TinyMCE to root /js folder. Two things to keep in mind here. Download regular version (not jQuery version) of TinyMCE. This is due to the fact that Magento uses Prototype, so we need to avoid conflicts. Second, watch out for unpack location. Your tiny_mce.js file should be accessible on <code>js/tiny_mce/tiny_mce.js</code> path.</p> <p><h2>Step 2.</h2> Open the <code>app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php</code> file. Locate the</p> <pre><code> $fieldset->addField('content', 'editor', array( 'name' => 'content', 'label' => Mage::helper('cms')->__('Content'), 'title' => Mage::helper('cms')->__('Content'), 'style' => 'height:36em;', 'wysiwyg' => false, 'required' => true, )); </code></pre> <p>and change it to</p> <pre><code> $fieldset->addField('content', 'editor', array( 'name' => 'content', 'label' => Mage::helper('cms')->__('Content'), 'title' => Mage::helper('cms')->__('Content'), 'style' => 'height:36em;', 'wysiwyg' => true, 'theme' => 'advanced', 'required' => true, )); </code></pre> <p>As you can see, here we changed on existing attribute ("wysiwyg") value and added new attribute "theme".</p> <p><h2>Step 3.</h2> Open the <code>/lib/Varien/Data/Form/Element/Editor.php</code> file and locate the method getElementHtml(). Here we change</p> <pre><code> $html = ' &lt;textarea name=&quot;'.$this-&gt;getName().'&quot; title=&quot;'.$this-&gt;getTitle().'&quot; id=&quot;'.$this-&gt;getHtmlId().'&quot; class=&quot;textarea '.$this-&gt;getClass().'&quot; '.$this-&gt;serialize($this-&gt;getHtmlAttributes()).' &gt;'.$this-&gt;getEscapedValue().'&lt;/textarea&gt; &lt;script type=&quot;text/javascript&quot;&gt; // &lt;![CDATA[ /* tinyMCE.init({ mode : &quot;exact&quot;, theme : &quot;'.$this-&gt;getTheme().'&quot;, elements : &quot;' . $element . '&quot;, theme_advanced_toolbar_location : &quot;top&quot;, theme_advanced_toolbar_align : &quot;left&quot;, theme_advanced_path_location : &quot;bottom&quot;, extended_valid_elements : &quot;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]&quot;, theme_advanced_resize_horizontal : &quot;false&quot;, theme_advanced_resizing : &quot;false&quot;, apply_source_formatting : &quot;true&quot;, convert_urls : &quot;false&quot;, force_br_newlines : &quot;true&quot;, doctype : \'&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;\' });*/ //]]&gt; &lt;/script&gt;'; </code></pre> <p>to</p> <pre><code> $html = ' &lt;textarea name=&quot;'.$this-&gt;getName().'&quot; title=&quot;'.$this-&gt;getTitle().'&quot; id=&quot;'.$this-&gt;getHtmlId().'&quot; class=&quot;textarea '.$this-&gt;getClass().'&quot; '.$this-&gt;serialize($this-&gt;getHtmlAttributes()).' &gt;'.$this-&gt;getEscapedValue().'&lt;/textarea&gt; &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;/js/tiny_mce/tiny_mce.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt; //&lt; ![CDATA[ Event.observe(window, &quot;load&quot;, function() { tinyMCE.init({ mode : &quot;exact&quot;, theme : &quot;'.$this-&gt;getTheme().'&quot;, elements : &quot;' . $element . '&quot;, theme_advanced_toolbar_location : &quot;top&quot;, theme_advanced_toolbar_align : &quot;left&quot;, theme_advanced_path_location : &quot;bottom&quot;, extended_valid_elements : &quot;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]&quot;, theme_advanced_resize_horizontal : &quot;false&quot;, theme_advanced_resizing : &quot;false&quot;, apply_source_formatting : &quot;true&quot;, convert_urls : &quot;false&quot;, force_br_newlines : &quot;true&quot;, doctype : \'&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;\' }); }); //]]&gt; &lt;/script&gt;'; </code></pre> <p>As you can see, there were only three minor changes needed (download, modify, modify) to get the TinyMCE editor working.</p> <p>Hope this helps. Cheers.</p> <p>&copy; Branko Ajzele (<a href="http://inchoo.net/ecommerce/magento/how-to-make-tinymce-work-with-magento-cms-pages/" rel="nofollow noreferrer">source</a>)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload