Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, I have the following issue: I want to override a specific twig-template (login.twig) for a speci

Options
U0242J2SGTE
U0242J2SGTE Posts: 7 🧑🏻‍🚀 - Cadet
edited December 2021 in Help

Hi, I have the following issue:
I want to override a specific twig-template (login.twig) for a specific store only.
Therefore I created a module named "CustomerPage2B" which contains only the mentioned twig-file (same directory structure of course).
After clearing the cache, everything works fine when accessing this page within the store but I get the following entry in the .pathCache:
'@CustomerPage/views/login/login.twig' => '/data/src/Pyz/Yves/CustomerPage2B/Theme/default/views/login/login.twig',
The obvious problem is now that I get the same template rendered for all other stores as well.
Any suggestion how I could solve this problem?

Comments

  • U01DZ2DB92S
    U01DZ2DB92S Posts: 9 🧑🏻‍🚀 - Cadet
    Options

    I was already confronted with this mistake as well. The warmup of the twig cache has some problems here. Would be great if Spryker would fix this issue.

  • U0242J2SGTE
    U0242J2SGTE Posts: 7 🧑🏻‍🚀 - Cadet
    Options

    I just found a solution that works for me:
    override \Spryker\Yves\Twig2B\TwigConfig::getCacheFilePath
    and configure a separate pathCache for the module.
    Maybe that solves your problem as well?

  • U01DZ2DB92S
    U01DZ2DB92S Posts: 9 🧑🏻‍🚀 - Cadet
    Options

    This workaround sounds logical. If I will need store specific module in the future I will try this. At the moment the default works for me.