Zen Cart Logo
Forums / Addon Sideboxes / Categories Dressing

Categories Dressing

Views: 531,550

Results 421 to 440 of 2,268
11 Oct 2008, 4:52 AM
#421
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Categories Dressing

I have read online about optimizing Website, and everyone agrees that getting the customer to what they want on your site with the lowest amount of clicks is VERY important in conversion rates. I had this mod installed for a while, Used some of the features and ignored some. Today I decided I will Use this mod to the fullest.
Iam trying to make my main Categories to look like they are different sidebox so customers can browse the sub-categories directly, Now I know yellow had a mod called simple categorie tree on his site but his site seems to be down for the past 2 days.
know the questions I have:

  1. Can I display the main categories without a link so they look that they are Sidebox header???
  2. Is there a way around displaying the Sub-categorie on the main page rather than Yellows mod?
  3. I would also like to add a side box that will only be displayed in the product info page that will display the content of the categorie the product is, For example if a customer is looking at a Turbo Kit located under the Performance categorie the sidebox will diplay the Performance categorie as a right side Sidebox.
11 Oct 2008, 5:05 PM
#422
some_name_not_taken avatar

some_name_not_taken

Zen Follower

Join Date:
Sep 2008
Posts:
106
Plugin Contributions:
0

Re: Categories Dressing

Thank-you, Kuroi. - The debugger is very useful, but I still have no footer and no images in place of the category names either.

I am going to see if I can solve this problem the long way, ie: the PHP equivalent of HTTP use this specific hyperlinked image for this specific object, seeing as it looks like the only possible way to make images in place of titles work for product displayed on the main page without resorting to making all my products featured, special, or new.

Glamorousshoe, have you looked at Better Categories? - I have not used it myself, but it is almost a template modification and looks to have some of what you are looking for.

11 Oct 2008, 6:14 PM
#423
some_name_not_taken avatar

some_name_not_taken

Zen Follower

Join Date:
Sep 2008
Posts:
106
Plugin Contributions:
0

Re: Categories Dressing

Forget the absolute PHP coding I mentionned above - it won't work.

So there is absolutely no way PHP modifications will work at all for anyone wanting categories displayed as images on the main page with columnar layout and without resorting to using a featured, new, or specials box on their front page.

No wonder people use commercial carts!

13 Oct 2008, 9:07 AM
#424
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,

I thought I understood your solution, but I can't seem to get it to work in the tpl categories php. Could you please have one more look at the file and tell me what I need to replace with what? If I do it myself I get an unexpected else if and if I remove the else if thing I get an unexpected {

I think I'm missing something to do with a file flow or something but php is still very difficult for me :blush:

<?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 4162 2006-08-17 03:55:02Z ajeh $
 * Modified for Categories Dressing v2.2  by Glenn Herbert (gjh42)  2008-02-25
 */
  $disp_block = '';
  //$disp_block = '<br />'; //if not using display: block; in stylesheet, uncomment  this line
  $disp_block_head = '';
  //$disp_block_head = '<br />';  // for headings not block uncomment this line
  $content = "";
  
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
  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';
    }
	$current_path = str_replace("cPath=","",$box_categories_array[$i]['path']);
    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 {
      // categories dressing - add divider above specified cats
      if(in_array($current_path, explode(",",'3,22,21_56'))) { //replace numbers with your cat ids separated by commas
        $content .= '<hr class="catBoxDivider" />' . "\n";
      }
      // categories dressing - add (divider and) heading above a cat
	  switch ($current_path) {
	  case '23': //replace number with your desired cPath
        //$content .= '<hr class="catBoxDivider" />' . "\n";  // to add divider uncomment this line
        $content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') . '</span>':'Heading 1</span>' . $disp_block_head) . "\n"; 
	  break;
      }  
	  // categories dressing - category name mods
      $cat_name_display = $box_categories_array[$i]['name'];
//      $subcat_level = (substr_count($current_path, '_'); //strip out subcat indent 
//      $cat_name_display = substr_replace($cat_name_display,'',0,($subcat_level*strlen(CATEGORIES_SUBCATEGORIES_INDENT)));
	  $cat_img_bg = '';
	   // categories dressing - display image if exists for category name in current language - with title tag
      if ((int)$_GET[cPath] == 105) { // in Skull Shop - use different buttons
        if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif')) {
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"'); 
        }
      } else {
        if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
        }
      } // cPath 105  
	  // categories dressing - display image if exists for category name in current language - with title tag
      if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
        $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');  
	  // categories dressing - display background image if exists for category name - with title tag
	  } elseif (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catbg' . $current_path . '.gif')) {
        $cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'pixel_trans.gif', '', '100%', '100%', 'title="' . $box_categories_array[$i]['name'] . '"');
        $cat_img_bg = ' catBg' . $current_path;
      } else {
	    $cat_img_bg = '-text';//append to main classname
	  }
      $content .= '<a class="' . $new_style . $cat_img_bg . '" 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 .= '<span class="category-subs-parent">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
        } else {
          $content .= '<span class="category-subs-selected">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
        }
      } else {
        $content .= '<span class="category-not-selected">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
      } // category name mods

      if ($box_categories_array[$i]['has_sub_cat']) {
        $content .= CATEGORIES_SEPARATOR;
      }
      $content .= ($disp_block == '<br />'?'</a>':''); // categories dressing - adjust link end 

      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 .= ($disp_block == ''?'</span></a>':'') . $disp_block . "\n"; // categories dressing - adjust link end 

      // categories dressing - add subtext below a cat
	  switch ($current_path) {
	  case '23': //replace number with your desired cPath
        $content .= '<span class="catBoxSubtext">Subtext for cat 23 escape apostrophe\'s</span>' . $disp_block . "\n"; 
	  break;
	  } // subtext
    }
  }

  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') {
      //$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
      $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>' . $disp_block . "\n";
      }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {
      // display limits
//      $display_limit = zen_get_products_new_timelimit();
      $display_limit = zen_get_new_date_range();

      $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 .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-new.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-new.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . $disp_block . "\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 .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-featured.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-featured.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . $disp_block . "\n";
      }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      //$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-all.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-all.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }
  }
  $content .= '</div>';

Thanks a ton in advance!!!

Juliet

13 Oct 2008, 9:09 AM
#425
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

regarding post http://www.zen-cart.com/forum/showpost.php?p=609631&postcount=412

Hi Glenn,

I thought I understood your solution, but I can't seem to get it to work in the tpl categories php. Could you please have one more look at the file and tell me what I need to replace with what? If I do it myself I get an unexpected else if and if I remove the else if thing I get an unexpected {

I think I'm missing something to do with a file flow or something but php is still very difficult for me :blush:

<?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 4162 2006-08-17 03:55:02Z ajeh $
 * Modified for Categories Dressing v2.2  by Glenn Herbert (gjh42)  2008-02-25
 */
  $disp_block = '';
  //$disp_block = '<br />'; //if not using display: block; in stylesheet, uncomment  this line
  $disp_block_head = '';
  //$disp_block_head = '<br />';  // for headings not block uncomment this line
  $content = "";
  
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
  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';
    }
	$current_path = str_replace("cPath=","",$box_categories_array[$i]['path']);
    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 {
      // categories dressing - add divider above specified cats
      if(in_array($current_path, explode(",",'3,22,21_56'))) { //replace numbers with your cat ids separated by commas
        $content .= '<hr class="catBoxDivider" />' . "\n";
      }
      // categories dressing - add (divider and) heading above a cat
	  switch ($current_path) {
	  case '23': //replace number with your desired cPath
        //$content .= '<hr class="catBoxDivider" />' . "\n";  // to add divider uncomment this line
        $content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') . '</span>':'Heading 1</span>' . $disp_block_head) . "\n"; 
	  break;
      }  
	  // categories dressing - category name mods
      $cat_name_display = $box_categories_array[$i]['name'];
//      $subcat_level = (substr_count($current_path, '_'); //strip out subcat indent 
//      $cat_name_display = substr_replace($cat_name_display,'',0,($subcat_level*strlen(CATEGORIES_SUBCATEGORIES_INDENT)));
	  $cat_img_bg = '';
	   // categories dressing - display image if exists for category name in current language - with title tag
      if ((int)$_GET[cPath] == 105) { // in Skull Shop - use different buttons
        if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif')) {
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"'); 
        }
      } else {
        if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
        }
      } // cPath 105  
	  // categories dressing - display image if exists for category name in current language - with title tag
      if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
        $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');  
	  // categories dressing - display background image if exists for category name - with title tag
	  } elseif (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catbg' . $current_path . '.gif')) {
        $cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'pixel_trans.gif', '', '100%', '100%', 'title="' . $box_categories_array[$i]['name'] . '"');
        $cat_img_bg = ' catBg' . $current_path;
      } else {
	    $cat_img_bg = '-text';//append to main classname
	  }
      $content .= '<a class="' . $new_style . $cat_img_bg . '" 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 .= '<span class="category-subs-parent">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
        } else {
          $content .= '<span class="category-subs-selected">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
        }
      } else {
        $content .= '<span class="category-not-selected">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
      } // category name mods

      if ($box_categories_array[$i]['has_sub_cat']) {
        $content .= CATEGORIES_SEPARATOR;
      }
      $content .= ($disp_block == '<br />'?'</a>':''); // categories dressing - adjust link end 

      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 .= ($disp_block == ''?'</span></a>':'') . $disp_block . "\n"; // categories dressing - adjust link end 

      // categories dressing - add subtext below a cat
	  switch ($current_path) {
	  case '23': //replace number with your desired cPath
        $content .= '<span class="catBoxSubtext">Subtext for cat 23 escape apostrophe\'s</span>' . $disp_block . "\n"; 
	  break;
	  } // subtext
    }
  }

  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') {
      //$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
      $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>' . $disp_block . "\n";
      }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {
      // display limits
//      $display_limit = zen_get_products_new_timelimit();
      $display_limit = zen_get_new_date_range();

      $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 .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-new.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-new.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . $disp_block . "\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 .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-featured.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-featured.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . $disp_block . "\n";
      }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      //$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-all.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-all.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }
  }
  $content .= '</div>';

Thanks a ton in advance!!!

Juliet

13 Oct 2008, 4:00 PM
#426
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

I don't remember where I got the

You have:

  // categories dressing - display image if exists for category name in current language - with title tag
  if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
    $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
  }  

but the code should not look quite like that - the basic Cat Dressing tpl_categories.php hasphp
// categories dressing - display image if exists for category name - with title tag
if (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catimg' . $current_path . '.gif')) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
// categories dressing - display background image if exists for category name - with title tag
} elseif (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catbg' . $current_path . '.gif')) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'pixel_trans.gif', '', '100%', '100%', 'title="' . $box_categories_array[$i]['name'] . '"');
$cat_img_bg = ' catBg' . $current_path;
} else {
$cat_img_bg = '-text';//append to main classname
}


This should correctly account for buttons in the Skull Shop and outside it:
```php
	  // categories dressing - display image if exists for category name - with title tag
        if ((int)$_GET[cPath] == 105 and file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif')) { // in Skull Shop - use different buttons
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"'); 
        } elseif ((int)$_GET[cPath] != 105 and file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) { // not in Skull Shop - use standard buttons
        $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');  
      // categories dressing - display background image if exists for category name - with title tag
      } elseif (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catbg' . $current_path . '.gif')) {
        $cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'pixel_trans.gif', '', '100%', '100%', 'title="' . $box_categories_array[$i]['name'] . '"');
        $cat_img_bg = ' catBg' . $current_path;
      } else {
        $cat_img_bg = '-text';//append to main classname
      } 
13 Oct 2008, 4:04 PM
#427
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

Thank you very much once again!! I'm going to try to implement this tomorrow. I'll let you know when I got it in!

15 Oct 2008, 12:37 PM
#428
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,

I'm sorry I tried. I can see categories dressing is on because lines appear around it when I hover on the skull shop menu but now I can't see the buttons.

Also what is different is that only the first two buttons should be skull shop specific the other ones should be called normally. (because they only appear in skull shop)

Here's the code as I pasted it

	  break;
      }  
	  // categories dressing - category name mods
      $cat_name_display = $box_categories_array[$i]['name'];
//      $subcat_level = (substr_count($current_path, '_'); //strip out subcat indent 
//      $cat_name_display = substr_replace($cat_name_display,'',0,($subcat_level*strlen(CATEGORIES_SUBCATEGORIES_INDENT)));
	  $cat_img_bg = '';
      // categories dressing - display image if exists for category name - with title tag
        if ((int)$_GET[cPath] == 105 and file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif')) { // in Skull Shop - use different buttons
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"'); 
        } elseif ((int)$_GET[cPath] != 105 and file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) { // not in Skull Shop - use standard buttons
        $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');  
      // categories dressing - display background image if exists for category name - with title tag
      } elseif (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catbg' . $current_path . '.gif')) {
        $cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'pixel_trans.gif', '', '100%', '100%', 'title="' . $box_categories_array[$i]['name'] . '"');
        $cat_img_bg = ' catBg' . $current_path;
      } else {
        $cat_img_bg = '-text';//append to main classname
      }  
      $content .= '<a class="' . $new_style . $cat_img_bg . '" 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 .= '<span class="category-subs-parent">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
        } else {
          $content .= '<span class="category-subs-selected">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
        }
      } else {
        $content .= '<span class="category-not-selected">' . $cat_name_display . ($disp_block == '<br />'?'</span>':'');
      } // category name mods

It also first gave an error ($end) on line 192 or in that region, the only thing I found in that region was some commented lines so I uncommented them.

I'm also sending you a private message with more data than I want to drop on the board.

With kind regards,
Juliet

15 Oct 2008, 5:02 PM
#429
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Got your message! I can't take more time to look at it right now, but I will check on it late tonight.

15 Oct 2008, 5:04 PM
#430
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

Thank you so much :clap: you are an angel!!!!

15 Oct 2008, 5:47 PM
#431
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Note: the

        if ((int)$_GET[cPath] == 105 and file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif')) { // in Skull Shop - use different buttons

only uses the special buttons if in Skull Shop and the special buttons exist.
The

        } elseif ((int)$_GET[cPath] != 105 and file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) { // not in Skull Shop - use standard buttons

should really be changed to

        } elseif (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) { // not in Skull Shop or special button does not exist - use standard buttons
```because we don't want to limit those to outside the Skull Shop.
15 Oct 2008, 8:43 PM
#432
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

It worked!!!!!!!!!!!!!!! is jumping trough the roof of joy:clap::hug::laugh::clap:

Thank you so much Glenn! You are a star!!!

23 Oct 2008, 4:19 AM
#433
altisreef_com avatar

altisreef_com

New Zenner

Join Date:
Oct 2008
Posts:
17
Plugin Contributions:
0

Re: Categories Dressing

Yes I am a complete idoit and cant figure this out :)

I got the pics to work, but I cant get rid of the link heading text below new products. It says to edit out the line, but it doesnt work for me. I edited the words"link heading" and it goes away but leaves the pink box. When I erase the whole line the whole page vanishes.

See it here

http://altisreef.com/

23 Oct 2008, 6:56 AM
#434
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Just put comment marks // in front of the line:```php
if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
//$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-all.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-all.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link
$content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
}
}
$content .= '</div>';

23 Oct 2008, 12:52 PM
#435
altisreef_com avatar

altisreef_com

New Zenner

Join Date:
Oct 2008
Posts:
17
Plugin Contributions:
0

Re: Categories Dressing

Thank you. I was commenting it out to early.

GReat mod and thanks for the support.

Is there any way to put the pics on the horizontal nav bar on top?

23 Oct 2008, 8:21 PM
#436
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Yes, but the cat-tabs work differently than the categories sidebox, so the code doesn't translate directly.
It would take a bit of work to get automatic category images there.

23 Oct 2008, 11:54 PM
#437
altisreef_com avatar

altisreef_com

New Zenner

Join Date:
Oct 2008
Posts:
17
Plugin Contributions:
0

Re: Categories Dressing

Thanks for your time. If you every get into saltwater aquariums, look me up. I owe you one :)

21 Nov 2008, 5:00 PM
#438
russa2 avatar

russa2

New Zenner

Join Date:
Sep 2008
Location:
Indiana
Posts:
12
Plugin Contributions:
0

Re: Categories Dressing

I used some of your code.

$links_list = array();
while (!$categories_tab->EOF) {
if ($categories_tab->fields['categories_id'] != 65) {//skip cat id 65
// currently selected category
if ((int)$cPath == $categories_tab->fields['categories_id']) {
$new_style = 'category-top';
$categories_tab_current = '<span class="category-subs-selected">' . $categories_tab->fields['categories_name'] . '</span>';
} else {
$new_style = 'category-top';
$categories_tab_current = $categories_tab->fields['categories_name'];
}

// create link to top level category
$links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';
}//skip cat id 65
$categories_tab->MoveNext();

My question is, how do I not show more than one category?

-Russ
https://www.uniqueseason.com

22 Nov 2008, 9:10 AM
#439
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

If you want to skip two or three categories, you can just duplicate the test:```php
if ($categories_tab->fields['categories_id'] != 65 and $categories_tab->fields['categories_id'] != 69) {//skip cat id 65 & 69

If you have more to skip, you can use an explode function:```php
if (!in_array($categories_tab->fields['categories_id'], explode(',','65,69,77,123')) {//skip cat id 65, 69, 77, 123

See the comments at the top of
/includes/templates/template_default/common/tpl_main_page.php for a bit more info on this.

3 Dec 2008, 4:16 PM
#440
stxmona avatar

stxmona

Zen Follower

Join Date:
Aug 2008
Posts:
103
Plugin Contributions:
0

Re: Categories Dressing

I am a total newbie to php & css.

I have read and reread and reread the Read Me...looked through the forum and still can't get Categories Dressings to work. So I know that I am obviously missing something and appreciate your patience with me.

Here is what I have done -

  1. Installed CatDressing
  2. Uploaded the tpl_categories.php (did not make any adjustments to it - do I need to?) and added
    #categories a {
    background-repeat: no-repeat;
    display: block;
    }
    to my stylesheet & uploaded it
  3. I understand the cPath and have made my first gif....naming it catimage136.gif. Which should replace the flannel fabric words but doesn't. Then a pink "link Heading" appeared.

http://www.quiltsonbroadway.com/zen/index.php?main_page=

Thanks for all your help!!!
Mona