logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Wednesday, July 21, 2021 8:31:53 PM(UTC)
Joe Payne2

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?

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

mazhar  
#2 Posted : Monday, July 26, 2021 8:12:23 AM(UTC)
mazhar

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.
thanks 1 user thanked mazhar for this useful post.
Joe Payne2 on 7/26/2021(UTC)
Joe Payne2  
#3 Posted : Monday, July 26, 2021 8:32:16 AM(UTC)
Joe Payne2

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.
Users browsing this topic
Guest (3)
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.