Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2010
    Location
    Sacramento, CA
    Posts
    4
    Plugin Contributions
    0

    Default Need to Add a Link in the Categories Box

    I can't find this anywhere on the forum or FAQs.

    On the left side of the Cart is the CATEGORIES box. I have my categories that I have added through the ADMIN panel... but I need to add an outside link that isn't linked to the actual Zencart. Please help?

    I've tried editing the tpl_categories.php file... but I can't figure out where to add the text with a link. I just need it in the Categories box on the left, under the current category names. (Under Quilts / Wall Hangings). I need it to look like a Category Name, but link somewhere else.

    Link to site: http://www.lazydogdesigns.com/ecart

    Thanks so much!
    Last edited by Nehesh; 14 Dec 2010 at 11:37 PM.

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

    Default Re: Need to Add a Link in the Categories Box

    I answered this for someone else a few hours ago. You might try a basic search before posting a new question.
    Can I add alink in the Categories Sidebox?

    In your case, you would use a "subtext" comment on the last category to put your link content in.
    Last edited by gjh42; 15 Dec 2010 at 12:13 AM.

  3. #3
    Join Date
    Dec 2010
    Location
    Sacramento, CA
    Posts
    4
    Plugin Contributions
    0

    Default Re: Need to Add a Link in the Categories Box

    I saw that, but it didn't answer my question... in fact, I figured out how to fix it.

    I edited the tpl_categories.php file.

    After this array of code:

    Code:
     $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';
          }
         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)) {
          } else {
          $content .= '<a class="' . $new_style . '" 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">' . $box_categories_array[$i]['name'] . '</span>';
            } else {
              $content .= '<span class="category-subs-selected">' . $box_categories_array[$i]['name'] . '</span>';
            }
          } 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 />' . "\n";
        }
      }
    I added this code, and it populated the Text with the link I needed:

    Code:
      $content .= '<a class="category-top" href="http://LINK">TEXT</a>';

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

    Default Re: Need to Add a Link in the Categories Box

    Actually, it did contain an answer to your need, but what you did, for the very simple purpose you had, was a good way to do it.

  5. #5
    Join Date
    Dec 2010
    Location
    Sacramento, CA
    Posts
    4
    Plugin Contributions
    0

    Default Re: Need to Add a Link in the Categories Box

    Quote Originally Posted by gjh42 View Post
    Actually, it did contain an answer to your need, but what you did, for the very simple purpose you had, was a good way to do it.
    You're right. It did contain an answer... Your answer was what I had came up with, but it was still in the wrong place for where I needed it. The other answer was long, and cumbersome.

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

    Default Re: Need to Add a Link in the Categories Box

    Dimar's answer in post 9 (lower part), aside from naming the class "category-top", was exactly what you did.

 

 

Similar Threads

  1. Need help in changing font color in the categories box
    By trinorthlighting in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 27 Jun 2008, 05:14 AM
  2. How can I add a link into the categories sidebox?
    By PaulRiedel in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 1 Jan 2008, 10:09 AM
  3. Trying to add a link to the information box
    By teebo in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Jul 2007, 10:19 PM
  4. Need help moving the Add To Cart box
    By rstevenson in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 12 Jan 2007, 12:38 AM

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