Change Header for specific Category / Products

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Change Header for specific Category / Products

Post by ZLA » Mon Aug 31, 2009 5:37 am

We want to change the header logo for one particular category, its sub-categories and the products in those sub-categories. Currently, our header scriptlet has the logo's relative path coded directly. We aren't using an nvelocity variable for it. Is there an easy way to do this?

If I create a separate theme for these pages, do I have to duplicate everything in the secondary theme (and them maintain two sets of css / skin files to keep the shared portions consistent) or can I just define the differences in the secondary theme so the default theme is used for the shared portions?

Alternatively, can I use nVelocity in my standard header and somehow access a pages parent category to determine if it is a page that needs the alternate logo?

Thanks in advance.

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

Re: Change Header for specific Category / Products

Post by mazhar » Mon Aug 31, 2009 7:46 pm

Two different themes means that you have to create exact duplicate of first one and then extend it with changes. Secondly category object exposes a property named Parents that provides access on category parents. You can iterate over this and access category parents in nvelocity

Code: Select all

$category.Parents
.

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Change Header for specific Category / Products

Post by ZLA » Mon Aug 31, 2009 10:04 pm

mazhar wrote:Secondly category object exposes a property named Parents that provides access on category parents. You can iterate over this and access category parents in nvelocity.
Is that a reasonable approach for my header scriptlet or would it be better to create a conlib and use .NET code rather than nVelocity because of performance concerns?

Thank you.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Change Header for specific Category / Products

Post by AbleMods » Tue Sep 01, 2009 9:24 am

If you don't want two complete theme setups, just copy product.aspx and categorygrid<whichever>.aspx to new file names like product_pepsi.aspx and categorygrid_pepsi.aspx.

Then edit each copy and change the name tag:

Code: Select all

<DisplayPage>
    <Name>Basic Product</Name>
    <NodeType>Product</NodeType>
    <Description>A product display page that shows the basic product details.</Description>
</DisplayPage>
Now you have new display-page choices in the edit category page and the edit product pages. Assign your category and products to their new pages respectively. Browse to the pages as admin and set the scriptlets to be the ones you want for the alternate logo and Show Product content.

Since you have new ASPX pages for this category and these products, you can set completely different scriptlets than what the regular product.aspx and categorygrid<whatever>.aspx pages use. Now all that's needed a different scriptlet to drive your secondary header with alternate logo.

In the end, you're using specific category display and product display ASPX pages to drive your dynamic content while still maintaining a single common theme across the storefront.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Change Header for specific Category / Products

Post by ZLA » Tue Sep 01, 2009 9:37 am

Beautiful! :D

Thank you Joe. That's a great idea. I knew there had to be a simple solution. Again, my thanks.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Change Header for specific Category / Products

Post by AbleMods » Tue Sep 01, 2009 12:50 pm

Glad to help
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Change Header for specific Category / Products

Post by ZLA » Tue Sep 01, 2009 8:32 pm

Since you're on a roll, I thought I'd go for broke. Is it possible to select a product display page for a group of products without having to set it for each product in a group. Just curious.

Regards,

ZLA

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Change Header for specific Category / Products

Post by AbleMods » Tue Sep 01, 2009 9:02 pm

Yes. Look under the Manage menu for bulk product edit. You could also do it with a direct SQL command if you have access to your SQL db.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply