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

FCKEditor problems
 
Sintax
Member
 
Total Posts:  58
Joined:  2008-02-18
Hungary
 

Hi,

I followed the WIKI to use FCKEditor as the editor for CMS pages. Everything is good until I try to create a NEW page. It won’t allow me to save it since it complains that the content is empty and the field is required (even though it has text in FCK).

Once the page is created (e.g: editing an existing one) it allows it to be saved.

How can I disable the required field for the page content or fix this problem?

Thanks,
::Sintax

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pragman
Jr. Member
 
Total Posts:  5
Joined:  2008-05-26
 

I have the same problem.

The required fields doesn’t let me save the info.

I can ONLY save with the Save Button from the FCK, which is not good. Must save with Magento buttons.

Can anyone help ???

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

I have the same problem like Sintax, too!!

Anybody can help?  or how can I remove the “This is a required field” and let the content free.

Thanks a lot.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jacky2008
Member
 
Total Posts:  43
Joined:  2008-04-15
 
cooler - 05 June 2008 06:52 AM

I have the same problem like Sintax, too!!

Anybody can help?  or how can I remove the “This is a required field” and let the content free.

Thanks a lot.

I find a way to remove the “This is a required field” and let the content free.
1. for CMS - pages (go to \app\code\core\Mage\Adminhtml\Block\Cms\Page\Edit\Tab\ get ‘Main.php’ )
revised as below:

$fieldset->addField('content''editor', array(
            
'name'      => 'content',
            
'label'     => Mage::helper('cms')->__('Content'),
            
'title'     => Mage::helper('cms')->__('Content'),
            
'style'     => 'width:98%; height:600px;',
            
'wysiwyg'   => true,
            
'required'  => ture,   /*revised to   false*/
        
));

2. for CMS- blocks (go to \app\code\core\Mage\Adminhtml\Block\Cms\Block\Edit get ‘Form.php’ )
revised as below:

$fieldset->addField('content''editor', array(
            
'name'      => 'content',
            
'label'     => Mage::helper('cms')->__('Content'),
            
'title'     => Mage::helper('cms')->__('Content'),
            
'style'     => 'width: 98%; height: 600px;',
            
'wysiwyg'   => true,
            
'required'  => true,      /*revised to   false*/
        
));

Wish can help.
 
Magento Community Magento Community
Magento Community
Magento Community
 
Creeonix
Jr. Member
 
Total Posts:  1
Joined:  2008-06-20
 

/lib/Varien/Data/Form/Element/Editor.php and replace $html = ‘...’;

$html '<textarea name="'.$this->getName().'" title="'.$this->getTitle().
    
'" id="'.$this->getHtmlId().'" class="textarea '.$this->getClass().'" '.
    
$this->serialize($this->getHtmlAttributes()).' >'.$this->getEscapedValue().'</textarea>
    <script type="text/javascript" src="/fckeditor/fckeditor.js"></script>
    <script type="text/javascript">
        window.onload = function() {
            var oFCKeditor = new FCKeditor( "' 
$element .'" ) ;
            oFCKeditor.BasePath = "/fckeditor/" ;

            // You can do this istead of changing fskeditor.js
            oFCKeditor.Height = "600" ; 

            oFCKeditor.ReplaceTextarea() ;
        }
    </script>'
;

I want to add comment to WYSISWYG : How to article.
No need to change fskeditor.js file, you can do this as I did it in example above.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Reino
Sr. Member
 
Avatar
Total Posts:  78
Joined:  2008-06-22
Utrecht, The Netherlands
 

With the TinyMCE plugin the following line has to be changed (Magento version 1.1.3).
File: Editor.php
Function:  public function getElementHtml()

Event.observe(window'load', function() {
into:
Event.observe(window\'load\', function() {

And for the doctype line in the same file:

doctype '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
to
doctype \'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\'

It gave a parse error over here.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Reino
Sr. Member
 
Avatar
Total Posts:  78
Joined:  2008-06-22
Utrecht, The Netherlands
 

You posted a solution for the CMS blocks and pages above.
But no one for the description of products, where it can be handy to install the tinyMCE editor.
Does anyone knows where to edit the required fields for the products description?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danimaltron
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2008-01-29
 

I am getting “this is required field” when using TinyMCE on product pages (I dont use it on the CMS yet). I am using 1.1.3 Magento.

What do I edit to fix this?

I edited app/design/adminhtml/default/default/template/catalog/product/edit.phtml as according to Reino’s instructions, but with no luck. I guess the product pages are different. Or else I need to edit the fieldset, but I’m not sure where to do that.

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mario Baggio - Ebizmarts.com
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2008-02-14
Montevideo, Uruguay
 

Hi people!

I have found a dirty solution to use products with tinyMCE.

app/design/adminhtml/default/default/template/catalog/product/edit.phtml

At the top of the file, put this:

<?
$tinyMCE_elements 
'description,specs,features,short_description';
?>

Down in the code when you add the Js of tinyMCE, you have to put it in this way:

<script language="javascript" type="text/javascript" src="<?php echo $this->getJsUrl('tiny_mce/tiny_mce.js') ?>"></script>
<script language="javascript" type="text/javascript">
Event.observe(window'load', function() {
    tinyMCE
.init({
        mode 
"exact",
        
theme "advanced",
        
strict_loading_mode true,
        
elements "<?=$tinyMCE_elements?>",
        
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>

And at the end of the file:

<script language="javascript" type="text/javascript">
<?
$exploded 
explode(","$tinyMCE_elements) ;
foreach( 
$exploded as $tinyMCE_element { ?>
    setTimeout
("document.getElementById('<?=$tinyMCE_element?>').value='Empty Field'",5000);
<? } ?>
</script>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top