Override theme /plugin twig files does not work

Hello,

I have a clean installation of shopware 6 (mac with docker sync).
Create a theme plugin. Everything works with for example javascript. But overwriting a twig file does not work:

  • I’ve setted the cache: false in the twig yaml
  • I use the following path like the example: touch src/Resources/views/storefront/layout/header/logo.html.twig

Can somebody set me in the right direction? I cannot create themes / plugins without this working.

Hi Rappas,

 

you can find information on how to create theme’s for shopware 6, here

Information about working with Twig can be found here
Also remember that Twig doesn’t allow multi inheritance out of the box. Therefore we created our own twig functions sw_extends and sw_include.

Best regards,

Timmy

I’m having the same issue. However the installation on my server works like a charm. I have two options there:

  1. enable dev anvironment in .env and any changes to twig files are visible on refresh,
  2. or leave environment to production, cache on, but in this case I need to to go Settings -> system -> cache and clear cache

In both cases I can see the change in the twig file. Now, working on an installation on my client’s server I can’t get the changes to appear. The scss changes are visible, but twig is just dead. I don’t have access to anything else than custom theme folder so I can’t make any conf changes.

Does anyone have any idea what that could be and how to fix?

Thanks,
Grega

@Timmy_Clark schrieb:

Hi Rappas,

 

you can find information on how to create theme’s for shopware 6, here

Information about working with Twig can be found here
Also remember that Twig doesn’t allow multi inheritance out of the box. Therefore we created our own twig functions sw_extends and sw_include.

Best regards,

Timmy

Hey Timmy, I have the same issue with twig binding. Did the same said in link you put upper. I used clear DockWare image, Mac OS. Version  6.3.5.0. 

Changes in plugin config works well as a changes in styles. I also try make changes inside vendor views and they appear. But plugin views don’t want( 

The problem I had was docker-sync. But when installed correctly or using dockware these problems solved for my scenario on a Mac.

Hi Grega,

did you find a solution to this issue?
Back then, did you work with dockware:dev or dockware:essentials?

I’m working with dockware:essentials and I have the same issue that twigs are ignored; whether dev or prod in .env won’t change the problem; compiling the theme and clearing cache won’t work either.

Thanks
Roxana