Controlling category pages and product pages separately?

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
evanb@firefold.com
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 36
Joined: Mon Jul 21, 2008 3:45 pm

Controlling category pages and product pages separately?

Post by evanb@firefold.com » Thu Aug 28, 2008 8:17 am

Is it possible to control category pages and product pages separately? Right now we've run into a conflict where we need to customize our category/subcategory pages differently that our product pages. I haven't found a way to do this other than going to each page and individually changing it for that section only, is there another way around this?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Controlling category pages and product pages separately?

Post by jmestep » Thu Aug 28, 2008 3:37 pm

Are you meaning category pages that have subcategories vs. those that have products? If so, you can make a copy of one of the pages and conlibs and customize one for subcats and one for products. For example, I copied category4.aspx and related conlibs and related scriplet and use one set for subcats and one set for products.
If you mean a category display page vs a product display page, I'm not sure what you're asking since they are different display pages to start with.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Controlling category pages and product pages separately?

Post by William_firefold » Wed Sep 03, 2008 3:07 pm

The above answer was helpful but didnt work for us.
Here is an example of what we are working with on this one:

Image

The problem lies in the tree structure, and the fact that it assigns
the same div class to both subcategories and products.
We need there to be some differentiation between subcategories and products so we can manipulate them
separately.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Controlling category pages and product pages separately?

Post by mazhar » Thu Sep 04, 2008 2:08 am

Wrap all the contents inside the ItemTemplate of the DataList control in a div as below

Code: Select all

<ItemTemplate>
<div class='<%# GetClass(Container.DataItem) %>'>
....
....
....
</div>
</ItemTemplate>
Now add the following function in the .CS file of the current page.

Code: Select all

public string GetClass(Object dataItem) 
    {
        CatalogNode catalogNode = (CatalogNode)dataItem;
        if (catalogNode.CatalogNodeType == CatalogNodeType.Product)
            return "ProductNode";
        else
            return "CategoryNode";
    }
Now when you refresh the page the each category will be wraped in div with class CategoryNode and for product it will be ProductNode just define the styles for these both classes in CSS

Post Reply