这与“ shopware 6”插件已加载?
在不同插件中覆盖模板时,负载顺序很重要,取决于插件安装日期。
我相信在最近的售货机版本中,可以更好地解决此问题。
这是如何工作的?
This is related to In which order are Shopware 6 plugins loaded?
When overwriting templates in different plugins, the load order matters and depends on plugin installation date.
I believe in the recent Shopware version it is possible to solve this in a better way.
How is this working?
您可以将最后一个版本 getTemplatePriority 添加到捆绑类。返回的整数用于排序。 https://github.com/shopware/platform/commit/ad0535de2042c2c2c8cbb5c4f203780feae3ba0c70
getTemplatePriority
public function getTemplatePriority(): int { return 500; }
You can add since the last version a getTemplatePriority to your Bundle class. The returned integer is used for sorting. https://github.com/shopware/platform/commit/ad0535de2042c2c8cbb5c4f203780feae3ba0c70
您无法通过插件方式进行操作,因为主题始终比插件具有更高的视图优先级。
您应该创建一个扩展主题(儿童主题)
开发人员.shopware.com/docs/guides/plugins/ themes/add-theme-inheritance 您可以轻松覆盖模板当前主题。
... "views": [ "@Storefront", "@Plugins", "@SwagBasicExampleTheme", "@SwagBasicExampleThemeExtend" ],
You cannot do it by plugin way because theme always has higher priority of views than plugins.
You should create an extend theme (child theme) https://developer.shopware.com/docs/guides/plugins/themes/add-theme-inheritance
Then you can easily overwriting templates current theme.
您无法通过插件方式做到这一点,因为主题总是比插件具有更高的视图优先级。
在插件中,您可以添加一个从另一个插件延伸的空模板,然后在插件中使用此模板作为别名。
In your plugin you can add an empty template that extends from another plugin, then use this template in your plugin, as an alias.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(3)
您可以将最后一个版本
getTemplatePriority
添加到捆绑类。返回的整数用于排序。 https://github.com/shopware/platform/commit/ad0535de2042c2c2c8cbb5c4f203780feae3ba0c70You can add since the last version a
getTemplatePriority
to your Bundle class. The returned integer is used for sorting. https://github.com/shopware/platform/commit/ad0535de2042c2c8cbb5c4f203780feae3ba0c70您无法通过插件方式进行操作,因为主题始终比插件具有更高的视图优先级。
您应该创建一个扩展主题(儿童主题)
开发人员.shopware.com/docs/guides/plugins/ themes/add-theme-inheritance 您可以轻松覆盖模板当前主题。
You cannot do it by plugin way because theme always has higher priority of views than plugins.
You should create an extend theme (child theme) https://developer.shopware.com/docs/guides/plugins/themes/add-theme-inheritance
Then you can easily overwriting templates current theme.
在插件中,您可以添加一个从另一个插件延伸的空模板,然后在插件中使用此模板作为别名。
In your plugin you can add an empty template that extends from another plugin, then use this template in your plugin, as an alias.