我创造了一系列的产品,但我需要根据设计师的设计风格。我知道我必须覆盖来自/modules/contrib/commerce/modules/product/templates/commerce-product.html.twig的模板,但是在我的主题中应该把它放在哪里呢?
它会转到“我的模板”文件夹的根目录吗?什么是正确的方式,风格单一的产品页面?
发布于 2018-03-14 06:29:23
要做到这一点,只需从商业中的产品模块创建commerce-product.html.twig到主题的模板目录的副本即可。
有关访问https://docs.drupalcommerce.org/commerce2/developer-guide/products/displaying-products/theme-product的更多指导。
发布于 2020-01-31 07:52:54
@艾米玲
此用例的最佳实践是,在主题模板文件夹中创建一个产品文件夹,并从商业目录中的产品模块中创建commerce-product.html.twig的副本。
例: web/themes/custom/custom_theme/templates/product/commerce-product.html.twig
有关访问https://docs.drupalcommerce.org/commerce2/developer-guide/products/displaying-products/theme-product的更多指导。
https://drupal.stackexchange.com/questions/257644
复制相似问题