如何在magento的自定义类别属性中显示编辑器?
通过使用此链接,我添加了一个自定义类别属性如何在magento的自定义类别属性中显示编辑器?,magento,magento-1.8,Magento,Magento 1.8,通过使用此链接,我添加了一个自定义类别属性 http://www.atwix.com/magento/add-category-attribute/ 但它只显示文本区域,不显示编辑器。有人能告诉我哪里出了错或者我留下了什么吗 在 app/etc/modules/Atwix_CustomCategoryAttribute.xml <?xml version="1.0"?> <config> <modules> <Atwix_Cus
http://www.atwix.com/magento/add-category-attribute/
但它只显示文本区域,不显示编辑器。有人能告诉我哪里出了错或者我留下了什么吗
在
app/etc/modules/Atwix_CustomCategoryAttribute.xml
<?xml version="1.0"?>
<config>
<modules>
<Atwix_CustomCategoryAttribute>
<active>true</active>
<codePool>community</codePool>
</Atwix_CustomCategoryAttribute>
</modules>
</config>
真的
社区
app/code/community/Atwix/CustomCategoryAttribute/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Atwix_CustomCategoryAttribute>
<version>0.0.1</version>
</Atwix_CustomCategoryAttribute>
</modules>
<global>
<resources>
<add_category_attribute>
<setup>
<module>Atwix_CustomCategoryAttribute</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</add_category_attribute>
<add_category_attribute_write>
<connection>
<use>core_write</use>
</connection>
</add_category_attribute_write>
<add_category_attribute_read>
<connection>
<use>core_read</use>
</connection>
</add_category_attribute_read>
</resources>
</global>
</config>
0.0.1
Atwix_客户分类属性
图像\目录\模型\资源\设置
核心单元设置
核心写入
核心读取
app/code/community/Atwix/CustomCategoryAttribute/sql/add_category_attribute/mysql4-upgrade-0.0.1-0.0.2.php
<?php
$this->startSetup();
$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'custom_attribute', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'label' => 'Custom attribute',
'backend' => '',
'visible' => true,
'required' => false,
'visible_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$this->endSetup();
如果有人知道这一点,请帮助我
谢谢 您的升级脚本
mysql4-upgrade-0.0.1-0.0.2.php
将包含以下代码
<?php
$this->startSetup();
$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'custom_attribute', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'label' => 'Custom 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();
true,
有必要使用编辑器更改此属性中的内容,插入一些图像,格式化文本,并在末尾–保存更改创建自己的mysql升级脚本…mysql4-upgrade-0.0.1-0.0.2.php 这里,这个文件的代码是
$installer =new Mage_Catalog_Model_Resource_Eav_Mysql4_Setup;
$categoryEntityTypeId = $installer->getEntityTypeId('catalog_category');
$installer->updateAttribute($categoryEntityTypeId, 'custom_attribute', 'is_wysiwyg_enabled', 1);
$installer->endSetup();
这将更新您的类别属性。Price,您希望启用textarea字段的编辑器??是,但是我不知道怎么做?@PrinceKumar您的屏幕截图可能会帮助我使用上面链接中给出的代码,请参考并告诉我如何显示编辑器
config.xml
中的版本号以及您的安装脚本升级版本?您能告诉我如何知道您的数据库中的版本是0.0.1或0.0.2吗,在core\u resource
表下,在code
字段中搜索您的模块名称及其对应的version
$installer =new Mage_Catalog_Model_Resource_Eav_Mysql4_Setup;
$categoryEntityTypeId = $installer->getEntityTypeId('catalog_category');
$installer->updateAttribute($categoryEntityTypeId, 'custom_attribute', 'is_wysiwyg_enabled', 1);
$installer->endSetup();