Sylius - 覆盖模板

问题描述 投票:0回答:3

我试图重写Sylius店(前端)的网页模板。我已经放置在应用程序/资源/模板/包/ SyliusShopBundle模板(index.html.twig)。我的模板看起来是这样的:

{% extends '@SyliusShop/layout.html.twig' %}

{% block content %}
<p>this is a test</p>
<h2 class="ui horizontal section divider header">
    {{ 'sylius.ui.latest_products'|trans }}
</h2>
{{ render(url('sylius_shop_partial_product_index_latest', {'count': 4, 'template': '@SyliusShop/Product/_horizontalList.html.twig'})) }}
{% endblock %}

我已清除缓存,但我看不出有什么变化。我在想什么?

symfony twig sylius
3个回答
0
投票

你使用哪个版本Sylius?

在当前版本中,你应该把在模板目录中的模板。

更多信息:https://docs.sylius.com/en/latest/customization/template.html


0
投票

要更改主页模板(最新版本)尽量把它放在模板/包/ SyliusShopBundle /首页/ index.html.twig


0
投票

如果你使用Sylius 1.2(如果你有PHP 7.1),你的覆盖模板文件夹是在app/Resources/SyliusShopBundle/views

© www.soinside.com 2019 - 2024. All rights reserved.