Page 38 of 227 FirstFirst ... 2836373839404888138 ... LastLast
Results 371 to 380 of 2267
  1. #371
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Images as categories

    Boggled -

    The category names are straight text, so they are getting the -text added to the class name. Change the a.category-heading { to a.category-heading-text { and it should pick up the styling. This wasn't so much a mistake of yours as something I might have foreseen if I had thought about it.

  2. #372
    Join Date
    Aug 2008
    Posts
    19
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Hello,

    I am in need of a little clarification...i am trying to change my categories text links into image links. So far it does not work and i am wondering when you say "copy this in your stylesheet" are you referring to the CSS included in the download (which the code is already there) or my stylesheet.CSS which was there before the mod installation. So this is what i would add (copied this from another post, page 30)

    #categories a {
    background-repeat: no-repeat;
    display: block;
    }

    a.catBg14 {
    background-image: url(../images/catbg14.gif);
    height: 30px;
    }

    a.catBg14:hover {
    background-image: url(../images/catbg14hover.gif);
    height: 30px
    }

    And replace the 14 with my own cpath ?And when i add another image link, i just copy this again and change the number with the desired cpath number? Nothing else to add elsewhere except upload the image into my image folder? Lots of question marks eh? Thanks for any help on this matter.

    Matt

  3. #373
    Join Date
    Mar 2006
    Location
    Tennessee
    Posts
    310
    Plugin Contributions
    0

    Default Re: Images as categories

    Quote Originally Posted by gjh42 View Post
    Boggled -

    The category names are straight text, so they are getting the -text added to the class name. Change the a.category-heading { to a.category-heading-text { and it should pick up the styling. This wasn't so much a mistake of yours as something I might have foreseen if I had thought about it.
    Glenn,

    Thank you!!! That fixed it. They look and work perfect now.
    I'll finish that project tomorrow, I've made enough mistakes today!

  4. #374
    Join Date
    Aug 2008
    Posts
    19
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Well i found what i was looking for and answered all of my questions in the process Please ignore my above post

    Matt

  5. #375
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: Categories Dressing

    How can I alter the tpl_categories.php code so that I may use the same image and same image name for every category?

    I want to use rollover buttons in place of category names but I don't want to have to add entries to my .css and copy images with new names evertime I create a new cat.

    Thanks in advance,
    John

  6. #376
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Ohhh I was making it too hard on myself. a.category-top-text {}

    Thanks for the great mod!

    John

  7. #377
    Join Date
    Mar 2008
    Location
    Gouda, Netherlands
    Posts
    213
    Plugin Contributions
    1

    Default Re: Categories Dressing

    Hi Glenn,

    I'm sorry to bother you once again. I did exactly as you said in this post http://www.zen-cart.com/forum/showpo...&postcount=364 but it makes me end up with a text based menu again.

    I copied the php code exactly and also made language specific subfolders. I don't understand why it's not working.
    Working on http://www.skull-shop.net once again.

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

    Default Re: Categories Dressing

    I haven't tested the /images/language/ subfolder approach yet, so there is a chance that it won't work for some reason.

    I know that the /buttons/language/ subfolder approach works, so try altering your code and folders to that and see what happens.
    PHP Code:
          // 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'] . '"'); 

  9. #379
    Join Date
    Aug 2008
    Posts
    33
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Hi Glenn,
    first thanks a lot for this great mod :)
    I have a couple of questions: i have added this to my css:

    #categories a {
    background-repeat: no-repeat;
    display: block;
    }


    a.catBg1 {
    background-image: url(../images/catbg1.gif);
    height: 45px;
    }

    a.catBg1:hover {
    background-image: url(../images/catbg1hover.gif);
    }

    and have files called catimg1.gif, catbg1.gif, catbg1hover.gif.

    I can see the catimg file, but the rollover effect is not showing. instead i have a red background at the edge when I go on the cat. what am I doing wrong?

    another question: my site is bilingual and I want therefor for each language a different image, can this be done? if not, is it possible to have the cat name showing as text and have the bg? how do I do that?
    thanks a lot!!
    nilsen

  10. #380
    Join Date
    Mar 2008
    Location
    Gouda, Netherlands
    Posts
    213
    Plugin Contributions
    1

    Default Re: Categories Dressing

    Hi Glenn,

    I'm sorry but I'm still having no luck with it. Now the problem could very well be that I'm very new to php and am making beginners errors.

    Here's the php file (without the language things you wrote down to add because it wasn't working for me I had to take them out)
    PHP Code:
    <?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']) == 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_pathexplode(",",'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 - 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
          
    }
          
    $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>';
    ?>
    Now I was wondering where the buttons solution would need to go (I already have the buttons in language folders in my template) and if there's anything I need to adjust for my template. I tried pasting it somewhere but it started complaining about a parse error and not expecting an end.

    The template name I use is juliet and it's in the normal directory of templates /includes/templates/juliet

    Thanks a ton for your help, I'm so sorry that I have to keep bothering you.

    Juliet
    Working on http://www.skull-shop.net once again.

 

 

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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR