Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 12
WYSIWYG for CMS
 
turnon
Sr. Member
 
Total Posts:  129
Joined:  2008-02-20
 

and how add the editor in the product pages (description)

 
Magento Community Magento Community
Magento Community
Magento Community
 
turnon
Sr. Member
 
Total Posts:  129
Joined:  2008-02-20
 

ot is there a possibility for adding the hrnl codes directly in the content ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
fzolee11
Jr. Member
 
Total Posts:  12
Joined:  2008-03-01
Massachusetts
 

firespire,

Try this:
1) Go to http://www.magentocommerce.com/boards/viewthread/420/#t4973 and follow what Moshe says.
2) See this post: http://www.magentocommerce.com/boards/viewthread/420/#t13492
The code that worked for me at line 52 is the following:

<script language="javascript" type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>

Good luck!
Zee

 
Magento Community Magento Community
Magento Community
Magento Community
 
elong
Jr. Member
 
Total Posts:  17
Joined:  2008-02-15
 
fzolee11 - 01 March 2008 07:17 PM

firespire,

Try this:
1) Go to http://www.magentocommerce.com/boards/viewthread/420/#t4973 and follow what Moshe says.
2) See this post: http://www.magentocommerce.com/boards/viewthread/420/#t13492
The code that worked for me at line 52 is the following:

<script language="javascript" type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>

Good luck!
Zee

Thanks, the above works for me.

Has anyone tried the edit html button in the advanced wysiwyg editor? I tired, and I am only getting an empty window popup in firefox. It also appears that the {$lang_theme_code_title} and {$lang_theme_code_wordwrap} variables are not defined as well on this page. However, the page is only static html with some javascript, no php, so perhaps the variables weren’t set properly upon installation?

Any suggestions? I tied added the fq path to the javascript references just to see if it wasn’t picking up the scripts, but that doesn’t appear to be it.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Romain Fluttaz
Member
 
Avatar
Total Posts:  31
Joined:  2007-09-20
Chambery, France
 

+1 for : and how add the editor in the product pages (description)

 
Magento Community Magento Community
Magento Community
Magento Community
 
ANDI222
Member
 
Avatar
Total Posts:  41
Joined:  2008-02-26
 
iblastoff - 16 February 2008 09:49 PM

this is for the latest version of magento (0.8.16100)

since the backend now incorporates /index.php as part of the url (presumably because a lot of ppl were having url issues), it also screws up the url for tiny_mce.js (now it reads as http://www.yoursite.com/index.php/js/tiny_mce/tiny_mce.js which is wrong)

open up /lib/Varien/Data/Form/Element/Editor.php and at around line 52, where it has the following:

<script language="javascript" type="text/javascript" src="'.$this->getForm()->getBaseUrl().'js/tiny_mce/tiny_mce.js"></script>

just change it to the path of your magento installation. for example this works for me:
<script language="javascript" type="text/javascript" src="/'js/tiny_mce/tiny_mce.js"></script>

then do the change moshe mentions in his post above and now you have tiny_mce for your cms pages (personally i don’t see how this is useful here but meh)

Did you set your base link ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Liam Mc
Jr. Member
 
Total Posts:  6
Joined:  2008-01-07
 

Unfortunately the instructions from Moshe and iblastoff don’t work with the latest version of Magento (0.8.17240). /lib/Varien/Data/Form/Element/Editor.php has the tinyMCE.init function commented out.  Uncommenting it results in a tinyMCE toolbar but no edit frame (as seen in the attached jpg). 

I’m working on it, but I’ve only just started exploring Magento properly after abandoning ZenCart for an coming project.

Image Attachments
magento_tinymce.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
sdb
Sr. Member
 
Avatar
Total Posts:  223
Joined:  2007-11-13
coastal California, USA
 
austinstorm - 11 September 2007 05:51 AM

An option to turn it off, once it exists, would also be appreciated.

+1

 
Magento Community Magento Community
Magento Community
Magento Community
 
jjafuller
Jr. Member
 
Total Posts:  17
Joined:  2008-03-24
 

Yeah, I’ve got to the empty wysiwyg. And, there appears to be a js error related to it, “this.getDoc() is null”

I’ll be taking a look at it in more detail tomorrow.

 
Magento Community Magento Community
Magento Community
Magento Community
 
winzippy
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-02-08
Rochester, NY, USA
 

You may also find this helpful:

How to use FCKeditor with Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
winzippy
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-02-08
Rochester, NY, USA
 

I made a Wiki page for this topic located at:

WYSIWYG: A How-to.

It should be enough to get you started. Please feel free to add to the article.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sean Yeomans
Jr. Member
 
Avatar
Total Posts:  29
Joined:  2008-04-02
Winnipeg
 

Insert this code into the pages containing the textarea elements you wish to attach the WYSIWYG to

where would one insert this block into the pages you want affected? are there particular template files to add it to? I’m just unclear as to where to insert this block if I want it to affect the CMS pages, for example…
 
Magento Community Magento Community
Magento Community
Magento Community
 
winzippy
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-02-08
Rochester, NY, USA
 

For products, add the code around line 54 of app/design/adminhtml/defaut/default/template/catalog/product/edit.phtml.

For the CMS add the code at around line 52 of lib/Varien/Data/Form/Element/Editor.php, inside the $html variable and after the the <textarea>.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sean Yeomans
Jr. Member
 
Avatar
Total Posts:  29
Joined:  2008-04-02
Winnipeg
 

actually,
I placed this block in the file ‘app/design/adminhtml/default/default/template/page/footer.phtml’
(at first I put it into the ‘head.phtml’ but then I thought putting it in the footer would make more sense sine the content would be in the textareas by that point, but perhaps I’m confused as to when JS actions are triggered. its probably moot as to head or footer.)

notice the ‘elements’:

<script language="javascript" type="text/javascript" src="/magento/www/js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
    
tinyMCE.init({
        mode 
"exact",
        
theme "advanced",
        
elements "page_content,description,short_description",
        
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",
    
});              
</script>

anyways, I got this to work, the textareas are affected, however the contents of the textarea aren’t showing, and I get a js error saying

this.getDoc() has no properties

any clue as to why the JS wouldn’t see the textarea content object?

edit:  I get the same JS error when I do it the way you described. As in, the textarea affected but no content shows, just grey box like attachment

Image Attachments
wiggywizz.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
winzippy
Sr. Member
 
Avatar
Total Posts:  101
Joined:  2008-02-08
Rochester, NY, USA
 

I added my TinyMCE insert locations to the Wiki. Thanks for the question grin.

I’m guessing that the JS doesn’t see the textarea because the textarea is drawn first. If you put the JS calls in the Editor.php file as mentioned above, it will work.

Here’s what my Editor.php file looks like:

...
   public function 
getElementHtml()
    
{
        
if( $this->getWysiwyg() === true )
        
{
            $element 
= ($this->getState() == 'html') ? '' $this->getHtmlId();

            
$html '
                <textarea name="'
.$this->getName().'" title="'.$this->getTitle().'" id="'.$this->getHtmlId().'" class="textarea '.$this->getClass().'" '.$this->serialize($this->getHtmlAttributes()).' >'.$this->getEscapedValue().'</textarea>
                <script language="javascript" type="text/javascript" src="http://www.coffeeriot.com/magento/js/tiny_mce/tiny_mce.js"></script>
                <script language="javascript" type="text/javascript">
                    tinyMCE.init({
                        mode : "exact",
                        theme : "advanced",
                        elements : "' 
$element '",
                        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 : "false",
                        theme_advanced_resizing : "false",
                        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>'
;

                
/*plugins : "inlinepopups,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,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"*/

            
$html.= $this->getAfterElementHtml();
            return 
$html;
        
}
        
else
        
{
   
...
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 12