Results 1 to 10 of 2267

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories Dressing

    1: Yes, this is one of the basic functions of Categories Dressing. Name your images correctly and place them in the correct directory, and they will automatically be used. See the readme in the download for details.

    2: As originally written, the code does not support multiple languages. It is a very easy fix to achieve this, however. The image files are called for in several places in the code; replace each instance of

    DIR_WS_TEMPLATE_IMAGES . '

    with

    DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/

    and place the image files in
    /includes/templates/your_template/buttons/your_language/.

    3: This will require a bit more customizing, as the stylesheet can't use $_SESSION['language'].

    In tpl_categories.php, this section, for example,
    PHP Code:

          
    // categories dressing - display image if exists for category name
          
    if (file_exists(DIR_WS_TEMPLATE_IMAGES 'catimg' $current_path '.gif')) {
            
    $cat_name_display zen_image(DIR_WS_TEMPLATE_IMAGES 'catimg' $current_path '.gif'); 
          
    // categories dressing - display background image if exists for category name 
          
    } elseif (file_exists(DIR_WS_TEMPLATE_IMAGES 'catbg' $current_path '.gif')) {
            
    $cat_name_display '';
            
    $cat_img_bg ' catBg' $current_path;
          } else {
            
    $cat_img_bg '-text';//append to main classname
          

    will become
    PHP Code:
          // categories dressing - display image if exists for category name
          
    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'); 
          
    // categories dressing - display background image if exists for category name 
          
    } elseif (file_exists(DIR_WS_TEMPLATE 'buttons/' $_SESSION['language'] . '/catbg' $current_path '.gif')) {
            
    $cat_name_display '';
            
    $cat_img_bg ' catBg' $current_path '-' $_SESSION['language'];
          } else {
            
    $cat_img_bg '-text-' $_SESSION['language'];//append to main classname
          

    using $_SESSION['language'] to add
    -your_language
    to the end of class tags.

    In the stylesheet, replace each instance of

    url(../images/

    with

    url(../buttons/your_language/

    You will need a separate declaration for each language.
    Code:
    	
    /*example for individual category as bg image*/
    a.catBg25 {
        background-image: url(../images/catbg25.gif);
        height: 30px;
        }
    will become
    Code:
    	
    /*example for individual category as bg image*/
    a.catBg25-english {
        background-image: url(../buttons/english/catbg25.gif);
        height: 30px;
        }	
    
    a.catBg25-french {
        background-image: url(../buttons/french/catbg25.gif);
        height: 30px;
        }
    The same modifications can be applied to other parts of the code, depending on which functions you wish to use.
    Last edited by gjh42; 18 Oct 2007 at 04:50 AM.

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories Dressing

    After some more thought, I realized that it will be easier than I have indicated to support multiple languages.

    The
    DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/
    will be needed just as shown above, but the rest of the PHP code does not need to be changed.

    For all background images (which are specified in the stylesheet), you can create a language-specific stylesheet and place appropriate versions of the declarations in it. So in your base stylesheet.css for your default language, you will have
    Code:
    	
    /*example for individual category as bg image*/
    a.catBg25 {
        background-image: url(../buttons/english/catbg25.gif);
        height: 30px;
        }
    and for your alternate language (say French) you will have /includes/templates/your_template/css/french_stylesheet.css (all lowercase). In that you will change the url of the background image:
    Code:
    /*example for individual category as bg image*/
    a.catBg25 {
        background-image: url(../buttons/french/catbg25.gif);
        height: 30px;
        }
    so that when French is activated by the user, the French version will be displayed.

    Note: I believe this to be correct, but have not yet tested it. If anyone does this, please post here to confirm that it works or troubleshoot if it doesn't.

  3. #3
    Join Date
    Oct 2007
    Posts
    19
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Ahhhhhh! I just downloaded this and am reading the readme file under the instructions: "To display images in place of selected category names". I am sooo confused! There are so many things going on there and I have no idea what to do! I mean, I want to be able to have category images instead of just regular text sooo bad I'll pay someone to write me instructions that I can understand!

    Please help!

  4. #4
    Join Date
    Oct 2007
    Posts
    19
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Okay, wait...I think I am starting to get it now...but, why aren't the pictures showing up? I didn't make any original pictures for my site yet. But, I should see the already made ones that can with the Category Dressing Download, right?

    Here is my URL: www.wewuvanimals.com/store

    Why aren't I seeing the defult pictures you included in the download, Glenn?

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories Dressing

    Because the example images are set up for the category id's in the demo products package, and your categories don't include any of the same id's.

    If you rename some of the example images to category id's that you have on your site, you will see them replacing text.

    The readme includes descriptions of how each modification is done in the code, but you don't need to study that part. Concentrate on the directions for naming images and the like, and don't worry about the modifications that you are not interested in using.

  6. #6
    Join Date
    Oct 2007
    Posts
    19
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Quote Originally Posted by gjh42 View Post
    Because the example images are set up for the category id's in the demo products package, and your categories don't include any of the same id's.

    If you rename some of the example images to category id's that you have on your site, you will see them replacing text.

    The readme includes descriptions of how each modification is done in the code, but you don't need to study that part. Concentrate on the directions for naming images and the like, and don't worry about the modifications that you are not interested in using.
    Sorry if this sounds stupid but...how do I find out the cateorgy id's I have on my site?

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Categories Dressing

    They are displayed in the admin > Catalog > Categories/Products index, on the left side of the category name.

    You can also bring up a category page in your storefront and look at the address bar at the top of the window. There will be a "&cPath=24" in there when the category with id 24 is open.

  8. #8
    Join Date
    Aug 2010
    Posts
    77
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Hi, I just want to add a couple of non-linking headers in my categories, how can this be done? Not sure where I need to insert the code in the tpl_categories.php? Any help would be greatly appreciated.

    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2009 Glenn Herbert
    * @copyright Portions Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.gnu.org/licenses/ GNU Public License V3.0
    * @version $Id: tpl_categories.php 4162 2006-08-17 03:55:02Z ajeh $
    * Modified for Categories Dressing v2.7.3 by Glenn Herbert (gjh42) - 20090505
    *
    * Referenced files:
    * includes/functions/extra_functions/categories_dressing_functions.php
    * includes/languages/english/extra_definitions/your_template/categories_dressing_defines.php - make user settings here
    */
    $content = "";
    $prev_cat_depth = -1;//do not alter
    $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: #categories li.cat-holiday a {}
    // 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 = 'holiday';
    // break;
    case ($box_categories_array[$i]['top'] == 'true'):
    $new_style = 'top';
    break;
    case ($box_categories_array[$i]['has_sub_cat']):
    $new_style = 'subs';
    break;
    default:
    $new_style = 'products';
    }
    $current_path = str_replace("cPath=","",$box_categories_array[$i]['path']);
    $skip_cat = 0;
    $skip_cat = cat_active_level_manage($current_path);
    if ($skip_cat or 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 {
    $cat_box_heading = cat_box_heading($current_path);
    $cat_ul = cat_ul_manage($current_path, $prev_cat_depth, $cat_box_heading[0]);
    $content .= $cat_ul;
    $content .= $cat_box_heading[1];
    $cat_name_display = cat_name_display($box_categories_array[$i]['name'], $current_path);
    $active_class = ($box_categories_array[$i]['current'])? ($box_categories_array[$i]['has_sub_cat']? 'parent': 'selected'): 'not-selected';
    $content .= ' <li class="cat-' . $new_style . '"><a class="cat-' . $active_class . $cat_name_display[0] . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
    $content .= $cat_name_display[1];
    if ($box_categories_array[$i]['has_sub_cat'] and $cat_name_display[0] == '-text') {
    $content .= CATEGORIES_SEPARATOR;
    }

    if (SHOW_COUNTS == 'true' and $cat_name_display[0] == '-text') {
    if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
    $content .= '<span class="catCount">' . CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX . '</span>';
    }
    }
    $content .= '</a>';
    $content .= cat_box_subtext($current_path);
    }
    }
    $content .= cat_ul_manage(0, $prev_cat_depth, 0) . '</ul>' . "\n";

    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";
    }
    $content .= '<ul class="catLinks">' . "\n";
    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
    $cat_box_link_head = cat_box_heading('SPECIALS');
    $content .= $cat_box_link_head[1];
    $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
    if ($show_this->RecordCount() > 0) {
    $content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '</li>' . "\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) {
    $cat_box_link_head = cat_box_heading('NEW');
    $content .= $cat_box_link_head[1];
    $content .= ' <li><a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . '</li>' . "\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) {
    $cat_box_link_head = cat_box_heading('FEATURED');
    $content .= $cat_box_link_head[1];
    $content .= ' <li><a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . '</li>' . "\n";
    }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
    $cat_box_link_head = cat_box_heading('ALL');
    $content .= $cat_box_link_head[1];
    $content .= ' <li><a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . '</li>' . "\n";
    }
    $content .= '</ul>' . "\n";
    }
    $content .= '</div>';
    ?>

 

 

Similar Threads

  1. categories dressing
    By fw541c in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 19 Nov 2010, 09:29 PM
  2. Categories Dressing
    By wotnow in forum Addon Sideboxes
    Replies: 10
    Last Post: 7 Apr 2010, 03:06 AM
  3. Categories Dressing issue
    By Maynards in forum Addon Sideboxes
    Replies: 0
    Last Post: 13 Mar 2010, 10:51 PM
  4. Categories Dressing
    By Maynards in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Mar 2010, 11:05 PM
  5. Categories Dressing
    By PGlad in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Aug 2007, 07:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg