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
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
-
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/9458aec0eebe0d7d0595ab9839ce9e7bc7766202GitHub
Adds green theme ยท spryker-academy/frontend-forbackenddev-course@9458aec
Contribute to spryker-academy/frontend-forbackenddev-course development by creating an account on GitHub.0 -
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.
0 -
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
0 -
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
0 -
sure Hidran. Thanks for the clarification and suggestion.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random