element119 / module-page-builder-custom-data-attributes
一个允许向页面构建器内容添加自定义数据的 Magento 2 模块。
1.0.1
2022-01-27 11:56 UTC
Requires
- magento/module-page-builder: ^2.2
README
element119 | 页面构建器自定义数据属性
🤝 兼容性
对于 Adobe Commerce,请安装 element119/module-page-builder-custom-data-attributes-commerce
。
📝 功能
✔️ 允许向页面构建器内容添加自定义数据
✔️ 支持自定义页面构建器内容类型
✔️ 允许商店管理员完全控制自定义属性的 name
和 value
✔️ 使用动态行,允许管理员根据需要创建、编辑和删除自定义属性
🔌 安装
运行以下命令以 安装 此模块
composer require element119/module-page-builder-custom-data-attributes php bin/magento setup:upgrade
⏫ 更新
运行以下命令以 更新 此模块
composer update element119/module-page-builder-custom-data-attributes
❌ 卸载
运行以下命令以 卸载 此模块
composer remove element119/module-page-builder-custom-data-attributes php bin/magento setup:upgrade
🔧 自定义内容类型
要将自定义数据属性添加到自定义页面构建器内容类型,只需复制以下代码并将其粘贴到所有适当的 view/adminhtml/pagebuilder/content_type/{{custom_content_type}}.xml
文件的 <element name="main">
节点中。
<attribute name="custom_attributes" source="data-custom-attributes" converter="Element119_PageBuilderCustomDataAttributes/js/converter/attribute/custom-data-attributes"/>
以下显示了一个扩展的 XML 树作为示例。
<type name="your_custom_content_type_name"> <appearances> <appearance name="your_custom_content_type_appearance"> <elements> <element name="main"> <attribute name="custom_attributes" source="data-custom-attributes" converter="Element119_PageBuilderCustomDataAttributes/js/converter/attribute/custom-data-attributes"/> </element> </elements> </appearance> </appearances> </type>
📚 用户指南
配置和输出
注意事项
如果没有输出数据,则不会添加 HTML data-custom-attributes
属性。
对于想要支持此项目的人。