integer-net/magento2-global-custom-layout
Composer 安装命令:
composer require integer-net/magento2-global-custom-layout
包简介
Module for Magento 2 that allows you to add global layout update files to be selected from admin, by using '0' instead of an entity_id
README 文档
README
Allows you to add global layout update files to be selected from admin, by using 0 instead of a category_id / sku / url_path.
Compatible with Magento 2.3.4 and higher, since cms-page/product/category specific layouts where introduced in this version.
Purpose
In Magento 2.3.4, xml layout updates were removed from the Magento Admin, for security reasons. Previously this textfield allowed you to add XML Layout updates to any given Category, Product or CMS Page. After the update, this textfield is no longer available, but you can select custom layout updates which are defined in xml layout files in the filesystem.
After uploading/deploying selectable layout files onto your project's filesystem, these layouts can be selected from the admin under the Design section. The field is called Custom Layout Update.
Usage:
Replace identifiers in selectable layouts with a 0 (zero). Add layout file to themes/modules using:
- catalog_category_view_selectable_0_.xml for Categories
- catalog_product_view_selectable_0_.xml for Products
- cms_page_view_selectable_0_.xml for Cms pages
These files can go anywhere where you'd normally put layout files. For example:
app/design/frontend/[Theme_Vendor]/[Theme_Name]/Magento_Theme/layout/catalog_category_view_0_customchanges.xml
You can now select the layout update at any given Category/Product/Page, under Custom layout update field of Design.
More info on default behaviour of selectable layouts: Magento DevDocs: Create cms-page/product/category-specific layouts
Installation
- Install via composer
composer require integer-net/magento2-global-custom-layout - Enable module
bin/magento setup:upgrade
Configuration
Zero configuration needed.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Magento Integration Tests
-
Configure test database in
dev/tests/integration/etc/install-config-mysql.php. Read more in the Magento docs. -
Copy
Test/Integration/phpunit.xml.distfrom the package todev/tests/integration/phpunit.xmlin your Magento installation. -
In that directory, run
../../../vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Known issues
- Does not work with the homepage (cms_index_index). But hey, it doesn't in the default Magento implementation either.
Security
If you discover any security related issues, please email security@integer-net.de instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
integer-net/magento2-global-custom-layout 适用场景与选型建议
integer-net/magento2-global-custom-layout 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 103.57k 次下载、GitHub Stars 达 40, 最近一次更新时间为 2020 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 integer-net/magento2-global-custom-layout 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 integer-net/magento2-global-custom-layout 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 103.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 40
- 点击次数: 37
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-27