Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2007
    Posts
    104
    Plugin Contributions
    0

    Default Static Category Headings? Link header to main page?

    How can I make my top Main Category Images in my sidebox 'static'? But the sub-categories below them linkable?

    Also...

    How can I make my header link to the home page whenever someone clicks on it? Right now it does nothing.

    Thanks in advance!
    LMW1

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Static Category Headings? Link header to main page?

    Post a link to your site
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Mar 2007
    Posts
    104
    Plugin Contributions
    0

    Default Re: Static Category Headings? Link header to main page?

    starzbodyjewelry dot com

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Static Category Headings? Link header to main page?

    For your header:
    You only have a background image displayed and no logo image being displayed.
    Use your graphic program and seperate your "STARZ" image into it's own image as a gif and name it logo.gif place it into your template/images folder and if you have not edited out the display of the logo it will render and you can use css to position it.

    For the categories images post a bit of detail on how you have these entered
    Zen-Venom Get Bitten

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

    Default Re: Static Category Headings? Link header to main page?

    You are using Categories Dressing, and one of the expanded category mods, so I will address this accordingly.

    Considering the fact that you want three of the top categories (New Arrivals, Package Deals and Closeout) to be clickable, and the rest not, this approach will work best:

    In /includes/templates/your_template/sideboxes/tpl_categories.php, find
    PHP Code:
          $content .= '<a class="' $new_style $cat_img_bg '" href="' zen_href_link(FILENAME_DEFAULT$box_categories_array[$i]['path']) . '">';

    //(12 lines below)

          
    $content .= '</a>'
    and change to
    PHP Code:
          if ($new_style == 'category-top') {
            
    $content .= '<div class="' $new_style $cat_img_bg '" href="' zen_href_link(FILENAME_DEFAULT$box_categories_array[$i]['path']) . '">';
          } else {

            
    $content .= '<a class="' $new_style $cat_img_bg '" href="' zen_href_link(FILENAME_DEFAULT$box_categories_array[$i]['path']) . '">';}

    //(12 lines below)

          
    if ($new_style == 'category-top') {
            
    $content .= '</div>';
          } else {
            
    $content .= '</a>';
          } 
    By the way, I like your implementation, but have one suggestion: the top three links run together and it is not obvious that they are different links. If you give them a hover color, it will be obvious that they are separate links.

  6. #6
    Join Date
    Mar 2007
    Posts
    104
    Plugin Contributions
    0

    Default Re: Static Category Headings? Link header to main page?

    Thanks for the help guys! I think you may have mis-understood me. I want the top category headings to be static (not clickable). Only the sub-categories are clickable. Make sense? lol

    Hover color? Hmmmm? How would I do that?

    Thanks a million! I'm trying!
    LMW1

  7. #7
    Join Date
    Mar 2007
    Posts
    104
    Plugin Contributions
    0

    Default Re: Static Category Headings? Link header to main page?

    I tried replacing the code you provided above and it didnt work, it totally removed everything from the sidebox.

    Here's the code I have now. What do I need to change to make my top category headings static to where you cant click on them?

    $disp_block = '';
    $disp_block = '<br />'; //if not using display: block; in stylesheet, 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-bodyjewelry';
    break;
    case ($box_categories_array[$i]['path'] == 'cPath=4'):
    $new_style = 'category-hiphopjewelry';
    break;
    case ($box_categories_array[$i]['path'] == 'cPath=5'):
    $new_style = 'category-misc.';
    break;
    case ($box_categories_array[$i]['path'] == 'cPath=1'):
    $new_style = 'category-newarrivals';
    break;
    case ($box_categories_array[$i]['path'] == 'cPath=36'):
    $new_style = 'category-packagedeals';
    break;
    case ($box_categories_array[$i]['path'] == 'cPath=2'):
    $new_style = 'category-closeout';
    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
    $disp_block_head = '';
    //$disp_block_head = '<br />'; // for heading not block uncomment this line
    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'];
    $cat_img_bg = '';
    // 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
    }
    $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 . '</span>';
    } else {
    $content .= '<span class="category-subs-selected">' . $cat_name_display . '</span>';
    }
    } else {
    $content .= '<span class="category-not-selected">' . $cat_name_display . '</span>';
    } // category name mods

    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 .= $disp_block . "\n";

    // 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 in advance!
    LMW1

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

    Default Re: Static Category Headings? Link header to main page?

    Oops! I must have been distracted when I answered before. You would want to change the code shown to this:
    PHP Code:
          if ($new_style == 'category-top') {
            
    $content .= '<div class="' $new_style $cat_img_bg '">';
          } else {

            
    $content .= '<a class="' $new_style $cat_img_bg '" href="' zen_href_link(FILENAME_DEFAULT$box_categories_array[$i]['path']) . '">';
          }

    //(12 lines below)

          
    if ($new_style == 'category-top') {
            
    $content .= '</div>';
          } else {
            
    $content .= '</a>';
          } 
    eliminating the rest of the link code.

    The error could have stopped the regular top categories from displaying, but should not have affected the three special ones or the subcategories, since none of them would have $new_style equal to "category-top".

  9. #9
    Join Date
    Mar 2007
    Posts
    104
    Plugin Contributions
    0

    Default Re: Static Category Headings? Link header to main page?

    Please excuse me, but I think I'm missing something. I may be placing the code in the wrong place but it seems to not be working for me. One time I did it and I thought I got it right, but 'all' the links went static *(I couldnt even click on the subcategories below the top category headings.

    If you look at my site: starz body jewelry . com

    On the left navigation, there are 3 buttons..
    1) NEW ARRIVALS
    2) PACKAGE DEALS
    3) CLOSEOUT

    I want all 3 of them to be linked.

    Then 'under' them there are 3 Categories...
    1) BODY JEWELRY
    2) HIP-HOP JEWELRY
    3) MISCELLANEOUS

    I 'don't want' them to be linked, just static.

    Although the sub-categories 'below' them should be linkable.

    Can you help me get it right? Or tell me where I messed up at? I'd greatly thank you.

    Thank you Sir,
    Len

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

    Default Re: Static Category Headings? Link header to main page?

    Don't have time for a detailed reply right now, but when I first posted code for you, the "regular" top categories had tags of .category-top-text, which would be properly controlled by the code. Now you have special tags for every one of them, so the code is no longer applicable. You can eliminate the special tags ($new_style) for the regular top cats and control their display with a.category-top-text. You can also give all three special cats the same tag, since you want them styled the same, and have only one declaration to maintain in your stylesheet.

 

 

Similar Threads

  1. Static Category Link
    By jgdovin in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 31 Jul 2009, 03:08 AM
  2. Organise Main Category into Sub-Headings - and Showing them in Center Window
    By wokka in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Jun 2008, 12:37 AM
  3. Static Category Headings??
    By lmw1 in forum Basic Configuration
    Replies: 3
    Last Post: 6 Feb 2008, 07:28 PM
  4. Static main page that doesn't call header, footer, etc, etc
    By tqualizer_man in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 23 Nov 2006, 06:30 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