zit*_*tix 10 wysiwyg custom-attributes magento categories
我正在学习本教程:http://www.atwix.com/magento/add-category-attribute/ 一切正常,属性被添加到类别中,但没有字段下方的WYSIWYG按钮.系统>配置>内容管理中启用了所见即所得.
$this->startSetup();
$this->addAttribute('catalog_category', 'custom_att', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'label' => 'My attribute',
'backend' => '',
'visible' => true,
'required' => false,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'is_html_allowed_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$this->endSetup();
Run Code Online (Sandbox Code Playgroud)
无论我尝试什么,WYSIWYG都没有启用我的属性.有人可以帮忙吗?或者可能有一个解决方法吗?
编辑:我搜索了其他帖子,但都说这段代码应该添加WYSIWYG:
'wysiwyg_enabled' => true,
Run Code Online (Sandbox Code Playgroud)
但事实并非如此.
Tar*_*ras 11
试图今天完成相同的任务,并通过magento代码搜索设法完成我的任务与此代码:
$productEntityTypeId = $installer->getEntityTypeId('catalog_product');
$installer->addAttribute($productEntityTypeId, 'some_text', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'label' => 'Some Text',
'backend' => '',
'visible' => true,
'required' => false,
'visible_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$installer->updateAttribute($productEntityTypeId, 'some_text', 'is_wysiwyg_enabled', 1);
$installer->updateAttribute($productEntityTypeId, 'some_text', 'is_html_allowed_on_front', 1);
Run Code Online (Sandbox Code Playgroud)
小智 7
这有效:
$installer->updateAttribute('catalog_category', 'certifications', 'is_wysiwyg_enabled', 1);
$installer->updateAttribute('catalog_category', 'certifications', 'is_html_allowed_on_front', 1);
Run Code Online (Sandbox Code Playgroud)
这对我有用:
$installer->addAttribute('catalog_category', 'short_description', array(
'type' => 'varchar',
'label' => 'Short Description',
'input' => 'textarea',
'default' => '',
'sort_order' => 1,
'required' => false,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'is_html_allowed_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'group' => 'General Information',
));
Run Code Online (Sandbox Code Playgroud)
请注意以下三个条目:
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'is_html_allowed_on_front' => true,
Run Code Online (Sandbox Code Playgroud)
使用Magento CE 1.9.2.0.
| 归档时间: |
|
| 查看次数: |
10979 次 |
| 最近记录: |