Zen Cart Logo
Forums / General Questions / Custom Category description layout

Custom Category description layout

Locked

Views: 1,108

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
11 Dec 2008, 12:19 AM
#1
Join Date:
Mar 2006
Posts:
15
Plugin Contributions:
0

Custom Category description layout

I just wandered if there was some way to add an if statement to the category description on tpl_index_product_list.php

The reason for this is that I have a layout for category description text and the filter box set and it looks good but I have some categories that do not have any description on at all and then it looks awful

How would I add an if statement to the following code

<!-- categories_description bof -->
<?php
// categories_description
    if ($current_categories_description != '') {
?>
<div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description;  ?></div>
<?php } // categories_description ?>
<!-- categories_description eof -->

i.e. if category description not empty show my custom layout.

else do not show category description area but just show the product list

Please see attached image for more information

11 Dec 2008, 2:21 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Custom Category description layout

The code as you show it is already set to completely skip the #indexProductListCatDescription div if there is no description. If there is a larger area you want to hide, put the same test

if ($current_categories_description != '') {

}

around the code for it. Post that part of the file if you need guidance.

11 Dec 2008, 9:16 AM
#3
Join Date:
Mar 2006
Posts:
15
Plugin Contributions:
0

Re: Custom Category description layout

See what happens when you work to many hours with little coffee, you miss something that is staring you in the face.

Thanks for pointing my blindness out.

It worked a treat :smile: