Forums / General Questions / Display Category Description below category Title on the Product page

Display Category Description below category Title on the Product page

Views: 1,976

Results 1 to 12 of 12
12 Apr 2013, 3:19 PM
#1
alexander81 avatar

alexander81

New Zenner

Join Date:
Apr 2013
Location:
Florida
Posts:
6
Plugin Contributions:
0

Display Category Description below category Title on the Product page

For some reason this code is not working in 1.5.1

<?php $current_categories_description = ""; // categories_description $sql = "SELECT categories_description FROM " . TABLE_CATEGORIES_DESCRIPTION . " WHERE categories_id= :categoriesID AND language_id = :languagesID"; $sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer'); $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer'); $categories_description_lookup = $db->Execute($sql); if ($categories_description_lookup->RecordCount() > 0) { $current_categories_description = $categories_description_lookup->fields['categories_description']; } ?> <?php // categories_description if ($current_categories_description != '') { ?> <div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?>

Any ideas ?

12 Apr 2013, 3:35 PM
#2
alexander81 avatar

alexander81

New Zenner

Join Date:
Apr 2013
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: Display Category Description below category Title on the Product page

More info:

If you go to this site, you will have a better view what I am trying to say. The description is appearing between the two tittles.
you have to highlight it to be able to see it, it is in black. I want it next to the category image.

http://kingsunlimited.com/index.php?main_page=product_info&cPath=28_36&products_id=132

12 Apr 2013, 4:33 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Display Category Description below category Title on the Product page

You appear to have the color set to black in your stylesheet:

#indexProductListCatDescription, #categoryDescription {
color: #000000;
display: block;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
line-height: 18px;
overflow: hidden;
}

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Apr 2013, 4:59 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Display Category Description below category Title on the Product page

You will have to adjust the placement of this code in your Template Monster template file (/includes/templates/your_template/templates/tpl_product_info_display.php). The actual div that holds the image link is an insane seventeen levels deep inside the wrapper that makes the white box. You need to move the code so it is somewhere inside that nest, possibly just after the link code closes; it is hard to say where exactly without testing, as the file has so many containers sitting inside each other.

12 Apr 2013, 5:15 PM
#5
alexander81 avatar

alexander81

New Zenner

Join Date:
Apr 2013
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: Display Category Description below category Title on the Product page

Thanks for the reply.

I placed the code after the Category Icon (/includes/templates/your_template/templates/tpl_product_info_display.php):

<!--bof Category Icon --> <?php if ($module_show_categories != 0) {?> <?php /** * display the category icons */ require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?> <?php } ?> <!--eof Category Icon --> <!--Bof Category Description --> <?php $current_categories_description = ""; // categories_description $sql = "SELECT categories_description FROM " . TABLE_CATEGORIES_DESCRIPTION . " WHERE categories_id= :categoriesID AND language_id = :languagesID"; $sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer'); $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer'); $categories_description_lookup = $db->Execute($sql); if ($categories_description_lookup->RecordCount() > 0) { $current_categories_description = $categories_description_lookup->fields['categories_description']; } ?> <?php // categories_description if ($current_categories_description != '') { ?> <div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <!--Eof Category Description -->

Any Idea where the nest begins or Portion of the code that I need to look at ?

12 Apr 2013, 5:20 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Display Category Description below category Title on the Product page

The nest is apparently built entirely in tpl_modules_category_icon_display.php, so you will have to put your code in that file to get it inside the nest.

12 Apr 2013, 5:23 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Display Category Description below category Title on the Product page

The entire functional code of the stock version of that file is```php
/*...

  • @version $Id: tpl_modules_category_icon_display.php 6216 2007-04-17 06:09:57Z ajeh $
    */
    require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORY_ICON_DISPLAY));

?>

<div align="<?php echo $align; ?>" id="categoryIcon" class="categoryIcon"><?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath'], 'NONSSL') . '">' . $category_icon_display_image . $category_icon_display_name . '</a>'; ?></div> ``` Obviously the TM version will be much bigger.
12 Apr 2013, 5:36 PM
#8
alexander81 avatar

alexander81

New Zenner

Join Date:
Apr 2013
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: Display Category Description below category Title on the Product page

I am close. I just placed the code in tpl_modules_category_icon_display.php
I can see the description now, but it's not aligment properly.

http://kingsunlimited.com/index.php?main_page=product_info&cPath=28_36&products_id=132

<div align="<?php echo $align; ?>" id="categoryIcon" class="categoryIcon"> <!--Bof Category Description --> <?php $current_categories_description = ""; // categories_description $sql = "SELECT categories_description FROM " . TABLE_CATEGORIES_DESCRIPTION . " WHERE categories_id= :categoriesID AND language_id = :languagesID"; $sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer'); $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer'); $categories_description_lookup = $db->Execute($sql); if ($categories_description_lookup->RecordCount() > 0) { $current_categories_description = $categories_description_lookup->fields['categories_description']; } ?> <?php // categories_description if ($current_categories_description != '') { ?> <div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <!--Eof Category Description -->
12 Apr 2013, 5:45 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Display Category Description below category Title on the Product page

Try putting your code just after the categoryIcon div's closing </div>. You may need to float the description right (in your stylesheet) to get it on the same line as the image. Once they are displaying in the correct sequence, I can look at it and give you the style rules to use.

12 Apr 2013, 5:55 PM
#10
alexander81 avatar

alexander81

New Zenner

Join Date:
Apr 2013
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: Display Category Description below category Title on the Product page

Now the description is appearing underneath of the image.
We just need to aligment to the right and the middle.

12 Apr 2013, 6:39 PM
#11
alexander81 avatar

alexander81

New Zenner

Join Date:
Apr 2013
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: Display Category Description below category Title on the Product page

I already tried all places on that file, the best I can get is on the bottom or top of the image.
I was checking the stylesheet, but I do not want to modify the other category description, just this one.
It looks like I have to create a new one for this case.

12 Apr 2013, 11:13 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: Display Category Description below category Title on the Product page

Find in your styleshet.css (near the top) the rule for #indexProductListCatDescription, #categoryDescription {
Add the parts in red:```
#categoryIcon {width: 20%; float: left;}
#indexProductListCatDescription, #categoryDescription {float:right; width: 77%; display:block; overflow:hidden; color:#000000; font-family:Arial, Helvetica, sans-serif; line-height:18px; font-size:12px;}
.bg_inner91{height:10em;}