Multiple themes problem

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
wkudaka
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Fri Apr 13, 2012 11:26 am

Multiple themes problem

Post by wkudaka » Fri Apr 13, 2012 12:45 pm

I downloaded the ablecommerce trial version.

- Added a category called "Teste123".
- Inserted a new item in "Teste123":
Image

- The new item is registered in two categories:
Image

- when i access the item in "Teste123" category:
Image

The "Teste123" theme changes to the "Sample Category" theme (it was to still show the "Teste123" theme):
Image

Is there a way to the product page "inherit" the Parent Category theme?

wkudaka
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Fri Apr 13, 2012 11:26 am

Re: Multiple themes problem

Post by wkudaka » Mon Apr 16, 2012 4:01 pm

I searched in the code what was the problem.
I don't know if it will break any functionality, I modifed this file:

/App_Code/PageHelper.cs (line 511 to 525, the "BindCmdTheme" method)

Code: Select all

public static void BindCmsTheme(Page page, CatalogableBase catalogObject)
    {
        string theme = catalogObject.ActiveTheme;
        if (!string.IsNullOrEmpty(theme))
        {
            if (CommerceBuilder.UI.Styles.Theme.Exists(theme))
            {
                page.Theme = catalogObject.ActiveTheme;
            }
            else
            {
                //INVALID THEME SPECIFIED, LOG WARNING
                Logger.Warn("Invalid theme '" + theme + "' specified for catalog item " + catalogObject.Name + "; theme not applied.");
            }
        }else
        {

            int categoryId = GetCategoryId(true);
			
            var cat = CategoryDataSource.Load(categoryId);
			
            if (!String.IsNullOrEmpty(cat.Theme))
            {
                page.Theme = cat.Theme;
            }
        }
    }
Does someone knows if it will break any functionality?

Post Reply