Sylius-覆盖模板

时间:2019-01-20 14:05:12

标签: symfony twig sylius

我正在尝试覆盖Sylius商店(前端)的主页模板。我已经在 app / Resources / templates / bundles / 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 %}

我已经清除了缓存,但是看不到任何变化。我想念什么?

3 个答案:

答案 0 :(得分:0)

您使用哪个Sylius版本?

在当前版本中,您应该将模板放在模板目录中。

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

答案 1 :(得分:0)

要更改主页模板(最新版本),请尝试将其放在 templates / bundles / SyliusShopBundle / Homepage / index.html.twig

答案 2 :(得分:0)

如果使用Sylius 1.2(如果有php 7.1),则覆盖模板的文件夹位于app/Resources/SyliusShopBundle/views

相关问题