AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
theme.config, _base.layout.cshtml and bundleconfig.cs
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Can the devs explain the relationship between these files?
In the sample theme, there are some CSS and JS references in theme.config. None in _base.layout.cshtml. Several are in /App_Start/BundleConfig.cs
Here is my theory:
BundleConfig.cs is everything that is needed to drive the basic CMS features regardless of theme
_base.layout.cshtml shouldn't have any references, it's job is to render whatever is defined in BundleConfig
theme.config should have the css and js references specific to that particular theme
Am I on the right track here?
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
Quote:BundleConfig.cs is everything that is needed to drive the basic CMS features regardless of theme Yes, all the base styles/scripts required for the application to work are included in BundleConfig. This way we can bundle and minify when running in production mode. Quote:_base.layout.cshtml shouldn't have any references, it's job is to render whatever is defined in BundleConfig
Layout file does two things, first it uses the BundleConfig file to render the base script/styles. It also tries to render the current theme styles/scripts if any by using the _ThemeScripts and _ThemeStyles partial views. These view files use the current theme's configuration file to include the required script and styles theme needs. Quote:theme.config should have the css and js references specific to that particular theme Correct, you would only want to have theme specific resources in theme.config.
|
1 user thanked mazhar for this useful post.
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Excellent. Thank you for the clear explanation Mazhar.
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
theme.config, _base.layout.cshtml and bundleconfig.cs
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close