corrected path to logo template and overridden file code

This commit is contained in:
Maciej Woźniak 2021-07-21 15:37:07 +02:00 committed by Mateusz Zalewski
parent 1b0a5ed427
commit a50af8700a
No known key found for this signature in database
GPG key ID: 9BECA0BB71612E52

View file

@ -24,8 +24,8 @@ Default logo in shop panel:
The first step is to detect which template is responsible for displaying the logo and therefore which should be overridden
to customize a logo image.
It's placed in **SyliusShopBundle**, at ``Resources/views/_header.html.twig.path``, so to override it,
you should create the ``templates/bundles/SyliusShopBundle/_header.html.twig`` file and copy the original file content.
It's placed in **SyliusShopBundle**, at ``Resources/views/Layout/Header/_logo.html.twig.path``, so to override it,
you should create the ``templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig`` file and copy the original file content.
Next, replace the ``img`` element source with a link to the logo or properly imported asset image (take a look at
`Symfony assets documentation <https://symfony.com/doc/current/best_practices/web-assets.html>`_ for more info).
@ -38,18 +38,8 @@ At the end of customization, the overridden file would look similar to this:
.. code-block:: twig
<div class="ui basic segment">
<div class="ui three column stackable grid">
<div class="column">
<a href="{{ path('sylius_shop_homepage') }}"><img src="{{ asset('assets/logo.png') }}" alt="Logo" class="ui small image" /></a>
</div>
<div class="column">
{{ sonata_block_render_event('sylius.shop.layout.header') }}
</div>
<div class="right aligned column">
{{ render(url('sylius_shop_partial_cart_summary', {'template': '@SyliusShop/Cart/_widget.html.twig'})) }}
</div>
</div>
<div class="column">
<a href="{{ path('sylius_shop_homepage') }}"><img src="{{ asset('assets/logo.png') }}" alt="Logo" class="ui small image" /></a>
</div>
A custom logo should now be displayed on the Shop panel header: