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..

Hello guys. Question about themes. Is it possible to have different themes for different stores in s

U0145CP9Q6Q
U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

Hello guys. Question about themes. Is it possible to have different themes for different stores in spryker? In the docs I found only this https://documentation.spryker.com/docs/multi-theme-feature-overview. How can I specify the current theme for certain store?
And what will be the folder structure? For exmaple now I have the folder structure like on the screenshot. Does it mean that I can create another folder under Theme folder with name newTheme for example and use it for new theme?
And if yes - do I need to copy all components inside the new theme (with templates, css, js) or I can copy just css files, add additional styles and that it will be enough?
Spryker version is 202009.0.
Thanks.

Comments

  • Aleksander Kovalenko
    Aleksander Kovalenko Sprykee Posts: 45 🧑🏻‍🚀 - Cadet

    Hi Alex. Do you really need a separate theme for each store? Maybe you can just put everything specific to the store into store module extension - cartPage${storeName} for example? There is an article about it - https://documentation.spryker.com/docs/t-different-stores-different-logic-landing-pages

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    hmm... no. The logic will stay the same for all stores. There will be just another design for few new stores.
    Using this logic I have to copy the Theme folder few times in few new modules. I have now DE, AT and CH sotres. I need for example 3 new additional stores - new_DE, new_AT and new_CH. And all of them will have new design. So I think I need new theme for this to avoid copying the templates, css, js 3 times.

  • Aleksander Kovalenko
    Aleksander Kovalenko Sprykee Posts: 45 🧑🏻‍🚀 - Cadet

    So there are two ways:
    1. the way I mentioned above - Create store specific extensions - ShopUinew_DE , CartPagenew_DE and so on and use default theme. These modules gonna have usual modules as a fallback.
    2. Create separate themes and assign like this
    Shared/TwignewDE/TwigConfig.php

    <?php
    
    namespace Pyz\Shared\Twignew_DE;
    
    class TwigConfig extends \Spryker\Shared\Twig\TwigConfig
    {
        /**
         * @return string
         */
        public function getYvesThemeName(): string
        {
            return 'new-de-theme';
        }
    }
    
  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    but it is not possible to create just one theme and use in all stores, right? Without duplicating code

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    or in the second case i can just create folder in module and put just css files inside? without copying the templates and js. they will be used from default theme right?

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    in another words near the default folder i can create new-de-theme, new-at-theme etc folders and put my new styles inside. Am I right?

  • Aleksander Kovalenko
    Aleksander Kovalenko Sprykee Posts: 45 🧑🏻‍🚀 - Cadet

    but it is not possible to create just one theme and use in all stores, right? Without duplicating code

    It’s possible for sure. Just assign the same Yves theme for each store you need.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 🧑🏻‍🚀 - Cadet

    ah ok. now clear. thanks for your support!

  • Aleksander Kovalenko
    Aleksander Kovalenko Sprykee Posts: 45 🧑🏻‍🚀 - Cadet

    Welcome and have a great day!