nopCommerce Themes inheritance

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hello NopCommerce team,

I think great job is done and my appreciation and thanks for that.

In any case none systems are ideal, and there are always area to improve.

I would like to suggest you to implement Theme inheritance.
Another words it could be a base Themes which contains base set of theme content, and basing on that create new themes.
The root cause for that is that razor Views have very heavy influence on the system,
and by reworking them we can build pretty different html structure, layouts and performance.

I find it very reasonable to make different levels of customization:
- High level (changes in css / img / simple views)
- Deep level (changes views / js)

By using Theme inheritance it's possible to create a deep preset of customization, and use it as a base for many other Themes with high level customization (css/img).

Technical info:
- Add Param "BaseTheme" to theme.config, and responsible class;
- Make appropriate changes in ViewLocationFormats, AreaViewLocationFormats, MasterLocationFormats, AreaMasterLocationFormats.
- Maybe Theme details should be provided as a set of configurations to ThemeableVirtualPathProviderViewEngine.GetPath, instead of just theme name param.
- ... The other changes which I didn't discover yet.

I can do it by myself, but it would be much better to have in Nop.Framework and available for anyone.

Thank you, and hope it can be helpful for community.
PS: Sorry if this topic was raised somewhere and I didn't notice.
10 years ago
I agree with this idea! It will make it very easier for developers and theme designers to extend themes.
10 years ago
Thanks for suggestion. But I don't agree. It'll require a lot of coding, will make source code more complex, debugging of such themes will also become non trivial. And I'm not sure that such functionality is really demanded.
10 years ago
Just to be sure we are on the same line of understanding..

To be honest I already implemented it on my own environment, sure, I didn't process all the cases, and didn't consider the overall architecture solution, but the most important advantage I did, and it works perfectly...

Recursive Theme inheritance in case when it's not administration panel and admin user:
BaseTheme1 -> BaseTheme2 -> MyTheme
Sure I didn't want to change framework logic, and made it as monatomic as possible, with applying some hard coded workarounds.

Sorry for disagreements of your comment, but to be honest, code complexity, a lot of code and debugging problems are not so relevant in this case...

Change-1:
Two methods in partial class ThemableVirtualPathProviderViewEngine.

Change-2:
ThemableVirtualPathProviderViewEngine is made partial.

Change-3:
Added one code of line into GetPathFromGeneralName to call new method. (I didn't touch GetPathFromSpecificName)

Change-4:
Added One attribute to theme.config and ThemeConfiguration BaseThemeName.

Basically, that is it.

http://www.youtube.com/watch?v=sQYWnzz5WWQ
10 years ago
Hi, Is there any possibility of this implemented in near time. Working with Child themes will be much easier especially when working with multi-store solution where child themes can be created based on main theme. This will make theming development and maintenance easier.
10 years ago
sheretovev wrote:
Just to be sure we are on the same line of understanding..

To be honest I already implemented it on my own environment, sure, I didn't process all the cases, and didn't consider the overall architecture solution, but the most important advantage I did, and it works perfectly...

Recursive Theme inheritance in case when it's not administration panel and admin user:
BaseTheme1 -> BaseTheme2 -> MyTheme
Sure I didn't want to change framework logic, and made it as monatomic as possible, with applying some hard coded workarounds.

Sorry for disagreements of your comment, but to be honest, code complexity, a lot of code and debugging problems are not so relevant in this case...

Change-1:
Two methods in partial class ThemableVirtualPathProviderViewEngine.

Change-2:
ThemableVirtualPathProviderViewEngine is made partial.

Change-3:
Added one code of line into GetPathFromGeneralName to call new method. (I didn't touch GetPathFromSpecificName)

Change-4:
Added One attribute to theme.config and ThemeConfiguration BaseThemeName.

Basically, that is it.

http://www.youtube.com/watch?v=sQYWnzz5WWQ


Can you share the change that you made or create a fork on nopCommerce repository?
9 years ago
Hi,
we created a NopCommerce Child Theme Plugin ( like in WordPress)

Download link
https://www.nopcommerce.com/p/1592/child-theme.aspx
Or
http://www.uteam.co.il/en/platforms/nopcommerce/plugins/nopcommerce-child-theme-plugin/]http://www.uteam.co.il/en/platforms/nopcommerce/plugins/nopcommerce-child-theme-plugin/

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