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 everyone using marketplace b2c 202212.0 trying to override the Yves frontend template as explaine

U050SHLAFEE
U050SHLAFEE Posts: 3 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi everyone
using marketplace b2c 202212.0
trying to override the Yves frontend template as explained here: https://docs.spryker.com/docs/scos/dev/front-end-development/yves/atomic-frontend/customizing-spryker-front-end.html#twig

I created a module but it's not overriding or extending it, example: page-layout-main.twig
By the documentation it should work on a custom module but it looks like nothing is happening.

When I do changes on core Yves module I can see changes in the html.
On project level module it doesn't work.

Let me know if you have any ideas as to why it's not working as the documentation says it would.
Thank you!

Comments

  • Yuriy Gerton
    Yuriy Gerton Front End Technical Lead Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hello Lauren,
    Please check if the path is correct.
    It should be

    src/Pyz/Yves/ShopUi/Theme/default/templates/page-layout-main/page-layout-main.twig
    

    Then run the command to clear the TWIG cache

    docker/sdk console c:e
    
  • U050SHLAFEE
    U050SHLAFEE Posts: 3 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi Yuriy
    Yes that works,
    But I need to override it in a custom module
    and based on the doc it should work
    but it's not the case when I do that
    folder structure is the same:
    Ex;

    src/Pyz/Yves/MyModule/Theme/default/templates/page-layout-main/page-layout-main.twig
    
  • U050SHLAFEE
    U050SHLAFEE Posts: 3 πŸ§‘πŸ»β€πŸš€ - Cadet

    definitely ran this command many times:

    docker/sdk console c:e
    
  • Yuriy Gerton
    Yuriy Gerton Front End Technical Lead Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Most other modules extends the page-layout-main template from the ShopUi module.
    In this case, you’ll need to override them all to use a new custom module.

  • Yuriy Gerton
    Yuriy Gerton Front End Technical Lead Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    E.g. to see your new template on the Home page you need to extend your module in the src/Pyz/Yves/HomePage/Theme/default/views/home/home.twig template via {% extends template('page-layout-main', 'MyModule') %}