Styling Specific Category Pages

By Melanie Prough on Wednesday, April 7, 2010
Filed Under: Zen Cart Tips

This really doesn’t come up very often, but there are times that a specific Zen Cart category has special function or design need. In our case, the category needed a specific look. This category was set up as a landing page for a specific marketing campaign and needed to be styled in the likeness of the campaign pop.

To accomplish this, we use a Zen Cart hook for the category. This hook is the cPath number and can be utilized nearly anywhere in your Zen Cart template to define category specific elements. We specifically needed to change out the header for the marketing campaign. The page’s content was easily defined in the category HTML editor.

So we grabbed includes/templates/our_template/common/tpl_header.php and edited as follows:


<div id="headerWrapper">and immediately before it add:
if ((int)$cPath == 11) {
<div id="landingpage">
Landing page specific header code.
} else {

Now we can easily display our marketing promo header on this landing page. This “hook” can be used for any category page specific need in your Zen Cart.

Tags: , , , , ,

Comments are closed.

Template Original