0
votes

I'm trying to override the homepage template of Sylius shop (frontend). I've placed a template (index.html.twig) in app/Resources/templates/bundles/SyliusShopBundle. My template looks like this:

{% 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 %}

I've cleared the cache but I don't see any changes. What am I missing?

3

3 Answers

1
votes

If you use Sylius 1.2 (If you have php 7.1), your folder for override templates is in app/Resources/SyliusShopBundle/views

0
votes

Which Sylius version you use?

In current version you should place templates in templates directory.

More information: https://docs.sylius.com/en/latest/customization/template.html

0
votes

To change the homepage template (in the latest version) try to place it in templates/bundles/SyliusShopBundle/Homepage/index.html.twig