Layout adapting

Questions around the Aimeos bundle for the Symfony framework
Forum rules
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
MSchrading
Posts: 19
Joined: 14 Aug 2019, 08:13

Layout adapting

Post by MSchrading » 14 Aug 2019, 10:50

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

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Layout adapting

Post by aimeos » 14 Aug 2019, 11:10

Place your file into ./templates/bundles/AimeosShop/base.html.twig to overwrite the original template:
https://symfony.com/doc/current/bundles ... #templates
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

MSchrading
Posts: 19
Joined: 14 Aug 2019, 08:13

Re: Layout adapting

Post by MSchrading » 14 Aug 2019, 13:04

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

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Layout adapting

Post by aimeos » 14 Aug 2019, 13:08

Can you try ./templates/bundles/AimeosShopBundle/base.html.twig instead?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

MSchrading
Posts: 19
Joined: 14 Aug 2019, 08:13

Re: Layout adapting

Post by MSchrading » 15 Aug 2019, 08:01

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

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Layout adapting

Post by aimeos » 15 Aug 2019, 16:59

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 ...
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Layout adapting

Post by aimeos » 16 Aug 2019, 15:11

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 :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply