Can someone explain themes?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Hi Lynn,

You should read up on how ASP.NET Themes working using the App_Themes folder. See (http://msdn.microsoft.com/en-us/library/wcyt4fxb.aspx) for more information.

Essentially you can create a new theme folder inside the App_Themes directory and add as many CSS/Skin files you like. At runtime, these will be referenced by your page.

However, one thing to note is that although there is a <pages theme...> setting in web.config, this is not what sets the theme in nopCommerce. This is done using code instead.

Every nopCommerce storefront page inherits from BaseNopPage - in the PreInit event we are setting the theme based on what you select in store settings.

Therefore (answering your question 3) if you wish to add new pages to the store, you must ensure that they inherit from BaseNopPage instead of System.Web.UI.Page (the default).

Regarding the App_Code directory, I think you are confusing a Web Site Project (uses App_Code) with a Web Application Project (this is what nopCommerce has and does not use App_Code). In a web application project, all code must be precompiled into an assembly. In a web site project, code inside App_Code is dynamically compiled by the ASP.NET runtime.

Therefore, you should not be using App_Code in nopCommerce. If you wish to combine code written in VB.NET you should put this into a separate class library project and then add a reference to this in the nopCommerce web application.

I hope this answers all your questions. Please refer to http://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx#wapp_topic5 for more information.

Ben
12 anos atrás
Alright, I'm following almost all of this discussion up to this point, but I wanted to know, what would be the easiest way to attach an addition style sheet for my theme.

So, we all know how hellish IE can be, so I normally create IE style sheets and attach them using <! if IE > but that's clearly not going to work because of the URL rewriting, and NopCommerce does a neat little trick when it attaches style sheets giving it the exact number of "../"s in order to find the style sheet file.

How would you guys recommend going about adding this, because I'm busy trying to come up with a way to add it correctly, not hacking a hack.

Laki.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.