Symfony Sylius-重写模板
我试图覆盖Sylius shop(前端)的主页模板。我在app/Resources/templates/bundles/SyliusShopBundle中放置了一个模板(index.html.twig)。我的模板如下所示:Symfony Sylius-重写模板,symfony,twig,sylius,Symfony,Twig,Sylius,我试图覆盖Sylius shop(前端)的主页模板。我在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 di
{% 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 %}
{%extends'@SyliusShop/layout.html.twig%}
{%block content%}
这是一个测试
{{'sylius.ui.latest_products'| trans}}
{render(url('sylius_shop_partial_product_index_latest',{'count':4,'template':'@SyliusShop/product/_horizontalList.html.twig'}))}
{%endblock%}
我已清除缓存,但未看到任何更改。我遗漏了什么?您使用的是哪种Sylius版本 在当前版本中,您应该将模板放置在templates目录中
更多信息:要更改主页模板(最新版本),请尝试将其放置在模板/bundles/SyliusShopBundle/homepage/index.html.twig如果使用Sylius 1.2(如果使用php 7.1),则覆盖模板的文件夹位于
app/Resources/SyliusShopBundle/views