Controlling category pages and product pages separately?
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 36
- Joined: Mon Jul 21, 2008 3:45 pm
Controlling category pages and product pages separately?
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?
- 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?
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.
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
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
- William_firefold
- Commander (CMDR)
- Posts: 186
- Joined: Fri Aug 01, 2008 8:38 am
Re: Controlling category pages and product pages separately?
The above answer was helpful but didnt work for us.
Here is an example of what we are working with on this one:
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.
Here is an example of what we are working with on this one:
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.
Re: Controlling category pages and product pages separately?
Wrap all the contents inside the ItemTemplate of the DataList control in a div as below
Now add the following function in the .CS file of the current page.
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
Code: Select all
<ItemTemplate>
<div class='<%# GetClass(Container.DataItem) %>'>
....
....
....
</div>
</ItemTemplate>
Code: Select all
public string GetClass(Object dataItem)
{
CatalogNode catalogNode = (CatalogNode)dataItem;
if (catalogNode.CatalogNodeType == CatalogNodeType.Product)
return "ProductNode";
else
return "CategoryNode";
}