Change Header for specific Category / Products
Change Header for specific Category / Products
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.
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.
Re: Change Header for specific Category / Products
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
Re: Change Header for specific Category / Products
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?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.
Thank you.
Re: Change Header for specific Category / Products
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:
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.
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>
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
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
Re: Change Header for specific Category / Products
Beautiful!
Thank you Joe. That's a great idea. I knew there had to be a simple solution. Again, my thanks.

Thank you Joe. That's a great idea. I knew there had to be a simple solution. Again, my thanks.
Re: Change Header for specific Category / Products
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
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
Re: Change Header for specific Category / Products
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
Regards,
ZLA
Re: Change Header for specific Category / Products
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
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