Forums / Templates, Stylesheets, Page Layout / Category Picture shows on Left Box

Category Picture shows on Left Box

Locked

Views: 1,216

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
13 Sep 2006, 2:28 AM
#1
jojohi avatar

jojohi

New Zenner

Join Date:
Jun 2006
Posts:
13
Plugin Contributions:
0

Category Picture shows on Left Box

I have customized the main page, and want to show the category icon (picture) on the left column box, can anyone show me how to do so?

Also, is it possible that the category icon shows on the left box with 2 column?

i capture the screen to explain what I want, thank you very much.

[img]http://img7.picsplace.to/img7/26/thumbs/temp0.jpg[/img]

[img]http://img7.picsplace.to/img7/26/thumbs/temp1.jpg[/img]

-jojohi

13 Sep 2006, 4:16 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Category Picture shows on Left Box

Getting an image to display is the easy issue. But instead of telling you how to do this image thing, think this through. After you have an image displayed like yours that has A,B,C, etc. you now need this to function.

And that is the hard part as each letter will have to be an individual image so that one can assign a function to it. This will require more explanation than there is space for here.

If you definitely require this and can not do the coding yourself. You might consider obtaining paid assistance in the commercial section.

Zen-Venom Get Bitten

13 Sep 2006, 6:15 AM
#3
jojohi avatar

jojohi

New Zenner

Join Date:
Jun 2006
Posts:
13
Plugin Contributions:
0

Re: Category Picture shows on Left Box

kobra:

Getting an image to display is the easy issue. But instead of telling you how to do this image thing, think this through. After you have an image displayed like yours that has A,B,C, etc. you now need this to function.

And that is the hard part as each letter will have to be an individual image so that one can assign a function to it. This will require more explanation than there is space for here.

If you definitely require this and can not do the coding yourself. You might consider obtaining paid assistance in the commercial section.

thanks, i just quote an example, the ABC is actually the defined category name, as I want to draw some category picture icon and show it on the left sidebox, thanks.

-jojohi

15 Sep 2006, 6:34 AM
#4
jojohi avatar

jojohi

New Zenner

Join Date:
Jun 2006
Posts:
13
Plugin Contributions:
0

Re: Category Picture shows on Left Box

This is the tpl_categories.php file I have, can anyone advise how I can do?

<?php /** * Side Box Template * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_categories.php 3157 2006-03-10 23:24:22Z drbyte $ */ $content = ""; for ($i=0;$i<sizeof($box_categories_array);$i++) { switch(true) { // to make a specific category stand out define a new class in the stylesheet example: A.category-holiday // uncomment the select below and set the cPath=3 to the cPath= your_categories_id // many variations of this can be done // case ($box_categories_array[$i]['path'] == 'cPath=3'): // $new_style = 'category-holiday'; // break; case ($box_categories_array[$i]['top'] == 'true'): $new_style = 'category-top'; break; case ($box_categories_array[$i]['has_sub_cat']): $new_style = 'category-subs'; break; default: $new_style = 'category-products'; } if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) { // skip if this is for the document box (==3) } else { $content .= '<tr><td><img src=images/m19.gif width=5 height=5></td><td>  <a class=ml1 href=' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">'; if ($box_categories_array[$i]['current']) { if ($box_categories_array[$i]['has_sub_cat']) { $content .= $box_categories_array[$i]['name']; } else { $content .= $box_categories_array[$i]['name']; } } else { $content .= $box_categories_array[$i]['name']; } if ($box_categories_array[$i]['has_sub_cat']) { $content .= CATEGORIES_SEPARATOR; } $content .= '</a>'; if (SHOW_COUNTS == 'true') { if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) { $content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX; } } $content .= '<br><br class=px2></td></tr><tr><td colspan=2><img src=images/m20.gif width=151 height=1><br><br class=px2></td></tr>'; } } if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') { // display a separator between categories and links if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') { $content .= '<hr id="catBoxDivider" />' . "\n"; } if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') { $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1"); if ($show_this->RecordCount() > 0) { $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '<br />' . "\n"; } } if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') { // display limits $display_limit = zen_get_products_new_timelimit(); $show_this = $db->Execute("select p.products_id from " . TABLE_PRODUCTS . " p where p.products_status = 1 " . $display_limit . " limit 1"); if ($show_this->RecordCount() > 0) { $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . '<br />' . "\n"; } } if (SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true') { $show_this = $db->Execute("select products_id from " . TABLE_FEATURED . " where status= 1 limit 1"); if ($show_this->RecordCount() > 0) { $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . '<br />' . "\n"; } } if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') { $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n"; } } $content .= '</div>'; ?>