divante-ltd / pimcore-classification-store-importer
Pimcore 分类存储导入导出插件
v2.0.0
2022-05-14 15:43 UTC
Requires
- php: >=7.1
- ext-intl: *
- ext-json: *
- pimcore/pimcore: >=5.7
Requires (Dev)
- phpunit/phpunit: ^7.4
- symfony/phpunit-bridge: ^4.1
This package is auto-updated.
Last update: 2024-09-14 21:15:50 UTC
README
Pimcore5 插件,提供分类存储结构和其它功能的导入导出。
目录
兼容性
版本 1.0.0 - Pimcore 5.4.0 至 Pimcore 6.9 版本 2.0.0 - Pimcore 10.0 及更高版本
安装
composer require divante-ltd/pimcore-classification-store-importer
文档
https://divante.atlassian.net/wiki/spaces/KPWP/pages/896106614/Classificationstore+bundle
使用 - 导入
bin/console divante:classificationstore:import -f path/to/file/cs_structure.csv -d ";" -c "'"
其中 -d ";" 选项代表 CSV 分隔符;-c '"' 代表字段分隔符
CSV 文件中的每一行代表一个单独的项目:存储、集合、组或键。
每一行的格式为:param1;value1;param2;value2;param3;value3;...
常见参数
- item - 以下之一:store, collection, group, key
- name - 项目的名称
- description - 项目的描述
- store - 项目的存储名称(对于集合、组和键)
- groups - 属于集合的组的逗号分隔列表(仅针对集合)
- keys - 属于组的键的逗号分隔列表(仅针对组)
键参数
- type - 键的类型(目前支持:input, checkbox, booleanSelect, numeric, textarea, wysiwyg, select, multiselect)
- title - 键的标题
- 选择和多重选择选项提供如下:option_text1;Color blue;option_value1;3;option_text2;Color green;option_value2;4
其他参数取决于特定的键类型。
键的其他参数(默认值)
- booleanSelect: yesLabel (yes), noLabel (no), emptyLabel (empty), width
CSV 文件示例
item;store;name;store1;description;store1_description;;;;;;;;;;;;
item;store;name;store2;description;store2_description;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;
item;collection;store;store1;name;col1;description;col1_descr;groups;group1_name, group2_name;;;;;;;;
item;collection;store;store2;name;col2;description;col2_descr;groups;group1_name;;;;;;;;
;;;;;;;;;;;;;;;;;
item;group;store;store1;name;group1_name;description;gr1_descr;keys;key1_name,key2_name;sorter;key1_sorter_val,key2_sorter_val ;;;;;;;;;
item;group;store;store2;name;group2_name;description;gr2_descr;keys;sorter ;;;;;;;;;
;;;;;;;;;;;;;;;;;
item;key;store;store2;name;key2_name;title;key2_title;description;key2_description;type;input;;;;;;;;
item;key;store;store1;name;key1_name;title;key1_title;description;key1_description;type;select;option_text1;blue;option_value1;3;option_text2;green;option_value2;4
使用 - 导出
bin/console divante:classificationstore:export -f path/to/file/cs_structure.csv -d ";"
其中 -d ";" 选项代表 CSV 分隔符;-c '"' 代表字段分隔符
导出文件具有与上述导入文件相同的格式。
版本 1.0.0 备注
将关于 'sorter' 的信息添加到导出文件中。这允许在组内对键进行排序。
贡献
这是一个 Divante 的内部项目。
许可
此项目的代码在 GPLv3 许可下授权。
标准 & 代码质量
此模块遵守所有 Pimcore5 代码质量规则以及我们自己的 PHPCS 和 PHPMD 规则集。
关于作者
访问我们的网站 Divante.com 获取更多信息。