Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page 2 of 2
How to use FCKeditor with Magento
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

I have it fixed by modifying the code into this :

<?php 
$newproducturl
="http://localhost/magento/index.php/admin/catalog_product/save/"
if((
strcmp($this->getSaveUrl(),$newproducturl)!=0)||(strcmp($this->getHeader(),"New Product")!=0)){
echo '
<script type="text/javascript" src="http://localhost/magento/js/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( "description",500,300 ) ;
oFCKeditor.BasePath = "http://localhost/magento/js/fckeditor/" ;
oFCKeditor.ReplaceTextarea() ;
var oFCKeditor2 = new FCKeditor( "short_description",500,300 ) ;
oFCKeditor2.BasePath = "http://localhost/magento/js/fckeditor/" ;
oFCKeditor2.ReplaceTextarea() ;
}
</script>

'
;
}
?>

but it’s kinda brutal though....

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
I'm Done
Member
 
Total Posts:  32
Joined:  2008-05-08
 

It works! Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

Glad to help.

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
warriorgov9791
Jr. Member
 
Total Posts:  6
Joined:  2008-04-08
Hawaii
 

Thanks for the great work, Yoke! I got it attached to the short description. However, I get a “parse error on line 60...” message if I install the php script you posted above.

Edited:
Would like to also attach FCKeditor to Newsletter Templates and the static block editor under CMS. Does anyone know which files to modify? Thanks for everyone’s help, you’ve all been wonderful!

Update:
Got it attached to Static Block pages by changing the value for ‘wysiwyg’ from false to true in app / code / core / Mage / Adminhtml / Block / Cms / Block / Edit / Form.php

$fieldset->addField('content''editor', array(
            
'name'      => 'content',
            
'label'     => Mage::helper('cms')->__('Content'),
            
'title'     => Mage::helper('cms')->__('Content'),
            
'style'     => 'width: 550; height: 500px;',
            
'wysiwyg'   => true,
            
'required'  => true,
        ));

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

there is a thread about FCKEditor in this forum. use the search engine.
however, you should aware that FCKEditor doesn’t support writing PHP code in CMS.

Can you specify more details about the error? what page and what did you do?
also your version. thanks.

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
warriorgov9791
Jr. Member
 
Total Posts:  6
Joined:  2008-04-08
Hawaii
 

Hi Yoke,

Thanks, been following the various threads regarding FCKeditor for some time. The specific error message I get is this:

Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in /home/httpd/vhosts/mydomain.com/httpdocs/magento/app/design/adminhtml/default/default/template/catalog/product/edit.phtml on line 60

Copied your code and placed it in the edit.phtml file for product editing. Error occurs on the first page when I try to add a new product. Magento version: 1.0.19870.

Aloha!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

maybe you lack of that symbol “,” or “;” in that line.phtml on line 60.
check ur code and make sure it’s not lack of ;

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
haz
Jr. Member
 
Total Posts:  10
Joined:  2008-06-05
Melbourne, Australia
 
Yoke Lee - 19 May 2008 10:20 PM

I have it fixed by modifying the code into this :

$newproducturl="http://localhost/magento/index.php/admin/catalog_product/save/"
if((
strcmp($this->getSaveUrl(),$newproducturl)!=0)||(strcmp($this->getHeader(),"New Product")!=0)){

but it’s kinda brutal though....

To simplify, why not just check whether or not the textarea element exists first? For example, adding the following for the product description works for me:

if (document.getElementById('description')) {
    
var oFCK = new FCKeditor('description');
    
oFCK.BasePath "/fckeditor/";
    
oFCK.ReplaceTextarea();
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jacky2008
Member
 
Total Posts:  39
Joined:  2008-04-15
 

Hello, everyone

I am using v1.1.2 .  I only see blank area. Any help?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
alexNoosa
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2008-09-16
Noosa, Australia
 

Hi

Do you have a version of this working for the TinyMCE Editor?

Or tell me which file you inserted that code below?

Yoke Lee - 19 May 2008 10:20 PM

I have it fixed by modifying the code into this :

<?php 
$newproducturl
="http://localhost/magento/index.php/admin/catalog_product/save/"
if((
strcmp($this->getSaveUrl(),$newproducturl)!=0)||(strcmp($this->getHeader(),"New Product")!=0)){
echo '
<script type="text/javascript" src="http://localhost/magento/js/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( "description",500,300 ) ;
oFCKeditor.BasePath = "http://localhost/magento/js/fckeditor/" ;
oFCKeditor.ReplaceTextarea() ;
var oFCKeditor2 = new FCKeditor( "short_description",500,300 ) ;
oFCKeditor2.BasePath = "http://localhost/magento/js/fckeditor/" ;
oFCKeditor2.ReplaceTextarea() ;
}
</script>

'
;
}
?>

but it’s kinda brutal though....

 Signature 

bugento wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
skunker
Jr. Member
 
Total Posts:  11
Joined:  2008-04-27
 

Guys, I need some help here..I’m not sure how to do this as I am not a programmer by any means. So, this is what I want to do:

I just want to simply let me client use FCKeditor for the DESCRIPTION text area when he adds a new PRODUCT. So, I opened up edit.phtml and was not sure were to paste the FCKeditor snippet. My magento installation is at: http://www.ogmda.com/magento and my FCKeditor is installed in the magento folder.

So, how would I edit the FCKeditor snippet and where would I place it in the edit.phtml file?

<script type="text/javascript" src="<?php echo $this->getJsUrl('fckeditor/fckeditor.js') ?>"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor'id_of_element_where_you_want_to_attach_fckeditor' ) ;
oFCKeditor.BasePath "path/to/fckeditor/" ;
oFCKeditor.ReplaceTextarea() ;
}
</script>

 
Magento Community Magento Community
Magento Community
Magento Community
 
firespire
Jr. Member
 
Total Posts:  30
Joined:  2008-02-24
Cape Town, South Africa
 

yo,

grab this plugin Fontis_Wysiwyg <--- search site and install
will give you option for fck editor, tinymcp, and you can se this in the back end. one thing i have noticed is that my product description don’t save when i have updated it, will scratch around and see what i can find. I am using the latest 1.1.7 version of magento

EDIT:

With FCK editor short description doesnt update, but product description does
With TinyMCP neither short, nor long description updates

wins

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 2
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53143 users|475 users currently online|107143 forum posts