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 Team, Good Morning & Good Evening. I am new to Sryker and just started my training. I follow

Options
U04BB5G65KM
U04BB5G65KM Posts: 3 🧑🏻‍🚀 - Cadet

Hi Team,
Good Morning & Good Evening.

I am new to Sryker and just started my training.
I followed the steps mentioned in this video to bind a newly created theme to a store ('green' theme to be applied to 'DE' store) however the change was not reflecting on storefront.
https://academy.spryker.com/learn/course/381/play/3010/spryker-frontend-for-backend-developers

Can some one assist if i missed something?

Here are the changes I have done.
1. config/Yves/frontend-build-config.json :
{
"path": "assets/%SPRYKER_BUILD_HASH%/%namespace%/%theme%",
"staticPath": "assets/static",
"namespaces": [
{
"codeBucket": "",
"namespace": "",
"themes": ["green"],
"defaultTheme": "default"
}
]
}

2)TwigConfig.php has been updated to return 'green' theme for DE store

src/Pyz/Shared/TwigDE/TwigConfig.php

<?php

namespace Pyz\Shared\TwigDE;
use Spryker\Shared\Twig\TwigConfig as SprykerConfig;

class TwigConfig extends SprykerConfig
{
public function getYvesThemeName(): string
{
return 'green';
}
}

3) Created a theme folder 'green' in the following location.
*src/Pyz/Yves/ShopUi/Theme/green*

Thanks in Advance.

Comments

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 74 🏛 - Council (mod)
    Options

    Hi Sai,
    The code seems ok. Did you go into the console, *docker/sdk cli,* and run *npm run yves:watch — t green*
    If you did, you should see the green folder under public/Yves/assets/current
    You can also verify your modifications against the source code in github:
    https://github.com/spryker-academy/frontend-forbackenddev-course/commit/9458aec0eebe0d7d0595ab9839ce9e7bc7766202

    GitHub
    Adds green theme · spryker-academy/frontend-forbackenddev-course@9458aec
    Contribute to spryker-academy/frontend-forbackenddev-course development by creating an account on GitHub.

  • U04BB5G65KM
    U04BB5G65KM Posts: 3 🧑🏻‍🚀 - Cadet
    Options

    Hi @U03NFLE7WTG,

    Thank you for taking your time to check this.

    Yes, I ran the *npm run yves:watch — t green* and I was able to see the asset folder generated in public/Yves/assets/current. Overall, it has both default and green folders.

    I debugged further and it is observed that below file was pointing to the platform TwigConfig.php file but not to the one I have created.

    src/Generated/Shared/Kernel/Pyz/resolvableClassCacheDE.php

    'TwigSharedConfig' => '\\Spryker\\Shared\\Twig\\TwigConfig'
    

    I tried below commands to refresh the cache and now I can see the resolvableClassCacheDE.php is updated and also the theme is reflecting for my DE store.

    docker/sdk console cache:empty-all
    docker/sdk console cache:class-resolver:build

    'TwigSharedConfig' => '\\Pyz\\Shared\\TwigDE\\TwigConfig',
    

    I have one query. Should we always run above commands if we do any change in spryker?

    Thanks again for looking into this.

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 74 🏛 - Council (mod)
    Options

    Every time you override a core class, run docker/sdk console cache:class-resolver:build and for twig templates, propel and transfers docker/sdk console cache:empty-all

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 74 🏛 - Council (mod)
    Options

    If you use phpstorm by chance, you can go to preferences, file watchers and automatically add those commands whenever you modify that kind of files

  • U04BB5G65KM
    U04BB5G65KM Posts: 3 🧑🏻‍🚀 - Cadet
    Options

    sure Hidran. Thanks for the clarification and suggestion.