Can someone explain themes?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
Hello,
    I'm not a novice developer and I'm quite familiar with asp.net.

I'm perplexed, and perhaps I just haven't looked in the right place but...

We have an existing website. We want to add eCommerce to the functionality and we've decided to use nopCommerce (it looks a fantastic product).

I want to keep our site exactly as it was, but add a few links that will connect our customers to the checkout. My problem is this.

I've created (copied) an existing theme (darkOrange), renamed it as a new theme, and have chosen it in the configuration. I will customize this soon, however it's fine for testing as it is. When I access nop pages I can see in the source that it's pointing to the correct css files. BUT... somehow our original existing pages, once added to the nop project, (and are not connected to the nop master pages whatsoever) are picking up on the nop css!!! Further, they are picking up from the DarkOrange theme, not the new theme that I've added to the configuration.

Does anyone have an explanation? Or could someone point me to the file where nop overrides the default system.web.ui.page or some other voodoo???

Thanks
14 years ago
You said you will customize it soon, that means you have the same theme files.


You may try to remove the cache files of your browser and restart the application. After all css files are meant to be downloaded once. And all the themes will have the same name css files master.css, category.css, product.css
14 years ago
Hi jongbc,
      Thanks but that wasn't the problem.

Rather than explaining exactly what was going wrong, perhaps I'll explain my solution.

I was attempting to put both my existing site and nopCommerce at the same level on our website.
What I've changed is that the original site remains at the root, however now I've created a sub-folder "Shop" and put nopCommerce in there. Within IIS I configured that folder as its own webapp, and everything is hunky-dory. Should have done that in the beginning. (will make for cleaner upgrades and it keeps the code separated... also lets me continue to develop our main site in VB while nopCommerce is in C#)

So to kind of answer my orginal question, though I have yet to determine exactly how nopCommerce does it, when a page isn't part of a certain namespace?? then it seems to use the theme that's specified in the web.config, whereas pages conforming to ..?? (whatever the criteria is) will use the theme you specify in the gui interface. (sorry for getting so technical there :) )

When I'm done I'll post our site. (eta... 1 week?)

Thanks
Peb0
14 years ago
I am trying to find where the MasterPage calls the Style sheets and or Script Files.  I have a Style sheet for the overall look and feel and I use a JavaScript to check the browsser types and use the appropriate Stylesheet file to make sure it is backward compatable with other browsers.

I am still getting familar with this product but so far it looks as though it is a keeper!  I plan on getting licenses once I get my site looking right.
14 years ago
2 vsammons:
you will find all the css in the app_themes folder - this is where you should start customisation. The initial theme is called up in the web.config file (  <pages theme="darkorange">   ) if you change a theme in admin area, it is stored in the database so that when the shop loads, it knows what theme to use.

to get you started, i suggest you copy and paste one of the theme folders in the app_themes folder (eg darkorange) and rename it

to change a theme:  run the application , go to admin-->configuration--> global settings-->SEO/Display
you will see 'store theme' and a drop down list

you should see your new theme here - select it and save - click 'public store'

start changing the .css files in your selected theme, save them then go back to your browser and refresh the page to see your changes.

as others have said in the forum, firefox and firebug are indespensible tools

good luck
14 years ago
Stop spamming the forums.....
14 years ago
...deleted
14 years ago
..deleted
14 years ago
So the 2 questions posed, point to the same answer.

1) How is it that nopCommerce can "inject" style onto pages that don't use nop master pages? (my original problem).

2) Where is the code that does it? (I'd really like to know)

We aren't asking where the css files are, nor how css works.

What I've observed is that [somehow] nopCommerce dynamically reads in all style sheets from a Theme folder (as specified first in the Global Settings/Store Theme, then in the web.config). It reads them in alphabetically, so if you want to override any default nop style, you have to make a css file named zzz<name>.css or else it won't show (the obvious effect of cascading). (Note: I only add new css files, I don't modify original nop style sheets... even if copied to a new theme. I have a reasoning for this and can discuss it in a different thread if anyone is interested.)

This is pretty cool since you don't have to explicitly include the style sheets, you just have to watch out for cascading.

I have not spent a lot of time looking, but I'm still interested in knowing how nop does this.
14 years ago
I have exactly the same business need and questions..

(1) I need to merge nopCommerce with an existing site that is written in VB.NET;
(2) I need to modify the themes/styles;
(3) I added a very simple new page to the nopCommerce site.  This page contained no reference to master pages, themes, stylesheets, classes, etc. but when "View in Browser" is right-clicked, the page displayed contains SOME components of regular nopCommerce pages using the DarkOrange theme.  I did not tell the page to do this.  

Here is what I have discovered to-date:

(a) The entry <pages theme="DarkOrange"> in the nopCommerce web.config file is what is causing the "injection" of the theme into your pages that do not reference any themes, stylesheets, master pages, etc.  If you make this line of code <pages theme=""> you will not see this seemingly strange behavior.  A page with no references to themes, styles, etc. will display "plain vanilla".

(b) I have done limited testing with the change described in (a) above, and have not seen any problems arise, the nopCommerce site appears to run just fine using the theme selected in "admin-->configuration--> global settings-->SEO/Display in the store theme combo box.  The entry in the web.config file hopefully is just duplicate and needed.

(c) You can mix and match visual basic pages and c# pages in the same project.  There appears to some issues with doing this in the nopCommerce site (the actual store site), but it is technically possible.

(d) You apparently cannot mix visual basic and c# code in the App_Code folder without taking some additional steps in the construction of the project.  Refer to the following two links for details that I have found on the 'net:

http://channel9.msdn.com/forums/TechOff/168886-Mix-VBNET-amp-C-not-possible/      (read most if not all)

and

http://pietschsoft.com/post/2006/03/30/ASPNET-20-Use-VBNET-and-C-within-the-App_Code-folder.aspx

(e) I am embarking on building a new project from scratch using all of nopCommerce and adding my own site's VB pages along with the "dual App_Code folders" to test all of this and see if I can produce the desired results.  I hope it works!

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