Page 1 of 1

Layout adapting

Posted: 14 Aug 2019, 10:50
by MSchrading
Hi.

I'm very new to aimeos (2019.07.*), and I like to setup an aimeos shop under symfony 4.3/4.4. All worked good so fare but
the last adapting I can't solf. The problem is:

I've got this structure:

template/bundels/base.html.twig which could be found so I can adapt this basic layout. But in there is a twig block
{% block aimeos_scripts %}{% endblock %}

I which aimeos load this one: vendor/aimeos/aimeos-symfony/Resources/views/base.html.twig

So how can I override this template?

Thank you

Re: Layout adapting

Posted: 14 Aug 2019, 11:10
by aimeos
Place your file into ./templates/bundles/AimeosShop/base.html.twig to overwrite the original template:
https://symfony.com/doc/current/bundles ... #templates

Re: Layout adapting

Posted: 14 Aug 2019, 13:04
by MSchrading
Thank you for your fast response.

I did this but aimeos seems to load vendor/aimeos/aimeos-symfony/Resources/views/base.html.twig.

The point is, I have to change our layout complete due to change all the cdn's which I can't have access...

Is there another config i.e. yaml or something. I have also cleared the cache with ./bin/console cache:clear

Thankyou

Michael

Re: Layout adapting

Posted: 14 Aug 2019, 13:08
by aimeos
Can you try ./templates/bundles/AimeosShopBundle/base.html.twig instead?

Re: Layout adapting

Posted: 15 Aug 2019, 08:01
by MSchrading
Hello aimos.

Unfortunately no. I still got the base.html.twig loaded from vendor folder... :-/
I have a themes folder placed in ./public/bundels/aimeosshop/
And in ./public/bundels/aimeosshop/themes/elegance/ i have a aimeos.css file which will be overwritten, wenn I start composer update!! maybe something went wrong, when I installed your aimeos bundle in symfony4.3!?

Michael

Re: Layout adapting

Posted: 15 Aug 2019, 16:59
by aimeos
According to the Symfony docs placing a modified file in ./templates/bundles/AimeosShopBundle/base.html.twig should work. But we don't get it working either with Symfony 4.3 :-/

The files in ./public/bundles/aimeosshop/ are automatically overwritten by Symfony on update. You can change them but have to copy and modify them ... what brings us back to the problem of overwriting the base.html.twig ...

Re: Layout adapting

Posted: 16 Aug 2019, 15:11
by aimeos
Good news, we've found the problem. In Symfony 4 the template resolution syntax has changed but he old one still works ... without resolving overwritten templates.

Old:

Code: Select all

AimeosShopBundle:Catalog:list.html.twig
New:

Code: Select all

@AimeosShop/Catalog/list.html.twig
Run "composer update" to get aimeos/aimeos-symfony 2019.07.3 and your overwritten base.html.twig from the Aimeos bundle will be used :-)