Forums / Setting Up Categories, Products, Attributes / How to add new link to categories sidebox?

How to add new link to categories sidebox?

Views: 2,693

Results 1 to 20 of 26
8 Jan 2012, 2:56 AM
#1
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

How to add new link to categories sidebox?

I am wanting to add a new link with an arrow image for "FREE PRODUCTS" in the categories sidebox just above the links for "ALL" "FEATURED" and "NEW" products. I can't seem to find this info. anywhere online. See categories sidebox on my site https://www.moebow.com to see what I'm talking about..

Owner / Admin
http://www.moebow.com

8 Jan 2012, 5:31 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

If you use Categories Dressing for your categories sidebox, you can add a "heading" above the All Products link with HTML content that will look and act exactly the same as the other links.

In this case, the "similar threads" at the bottom of the page aren't helpful, but you could perhaps use the "Categories and EZ-Pages in same sidebox" mod in Free Addons, or else in /includes/templates/your_template/sideboxes/tpl_categories.php you could clone the All Products code and strip/alter it for your desired link.

10 Jan 2012, 1:06 AM
#4
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

Thank you kindly sir. I will add the code in the file. Your jewelry site is really good. I especially like the golden bar image you have to the side of your left column.

Owner / Admin
http://www.moebow.com

10 Jan 2012, 3:57 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

Thanks - that was one of my first forays into the wonders of CSS. The top of that border is a background image for one sidebox-type element, the center is a repeating background for #navColumnOneWrapper, and the bottom is a background for the last sidebox. This makes it infinitely adjustable in height. I was quite proud of it at the time:)

10 Jan 2012, 4:03 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

Huh... I just realized that my post #3 above was actually a response to another thread, which I thought I had not actually posted... oh well, at least it's not completely incongruous here:)

12 Jan 2012, 1:15 AM
#7
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

lol what a coincedence

Owner / Admin
http://www.moebow.com

12 Jan 2012, 3:46 AM
#8
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

gjh42:

If you use Categories Dressing for your categories sidebox, you can add a "heading" above the All Products link with HTML content that will look and act exactly the same as the other links.

In this case, the "similar threads" at the bottom of the page aren't helpful, but you could perhaps use the "Categories and EZ-Pages in same sidebox" mod in Free Addons, or else in /includes/templates/your_template/sideboxes/tpl_categories.php you could clone the All Products code and strip/alter it for your desired link.

So I tried editing the tpl_categories file using your code at http://www.zen-cart.com/forum/showthread.php?t=105690 and it's not doing a thing. Nothing showing up at all on my site. What could I be doing wrong?:frusty:

Here is how that section of my tpl_categories now looks :

// display a separator between categories and links

if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {

  $content .= '<hr id="catBoxDivider" />' . "\n";

}

echo '<a href="http://www.moebow.com/index.php?main_page=index&cPath=25_60">FREE Products</a><br />'. "\n";
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {

  $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>' . '<br />' . "\n";

  }

}

if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {

Owner / Admin
http://www.moebow.com

12 Jan 2012, 4:32 AM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

The code you show is based on the stock tpl_categories.php, but your site is using betterCategories, which has different source code.

Are you editing /includes/templates/template_default/sideboxes/tpl_categories.php? That will never be used; you need to add your code to /includes/templates/bookshelf/sideboxes/tpl_categories.php.

12 Jan 2012, 5:11 PM
#10
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

I actually edited both. So I need to edit the bettercategories file?

Owner / Admin
http://www.moebow.com

12 Jan 2012, 5:17 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

Yes. You should never touch any file in /template_default/; instead, copy it to the same folder in /your_template/ and edit the copy. Since there is already a copy, edit that.

12 Jan 2012, 5:34 PM
#12
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

i'm not finding a betterCategories file in that location..would it be elsewhere?

Owner / Admin
http://www.moebow.com

12 Jan 2012, 5:39 PM
#14
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

i'm totally lost then. i have already edited that file and it's not doing anything :(

Owner / Admin
http://www.moebow.com

12 Jan 2012, 5:50 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

The betterCategories version of the file is a bit different from stock in that area. php // $content .= '<br />' . zen_draw_separator('pixel_silver.gif') . '<br />'; // $content .= '<hr id="catBoxDivider" />' . "\n"; $content .= '<br style="line-height: 0;" />' . '<hr id="catBoxDivider" />' . '<br style="line-height: 0;" />'; } if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') { $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1"); if ($show_this->RecordCount() > 0) { $content .= '<div class="betterCategories"><a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">'; You would put your link between these two lines:```php
}
//your code here
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {

12 Jan 2012, 5:55 PM
#16
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

that's where it's already at.

Owner / Admin
http://www.moebow.com

12 Jan 2012, 6:19 PM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

Okay, then post that section of the file here so I can see exactly what you have.

And are you certain that your edited copy is on the server?

12 Jan 2012, 6:24 PM
#18
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

Yes I am positive it was uploaded successfully to my server.

// display a separator between categories and links
    if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
      $content .= '<br />' . zen_draw_separator('pixel_silver.gif') . '<br />';
    }
    // (heres my code) echo '<a href="http://www.moebow.com/index.php?main_page=index&cPath=25_60">FREE Products</a><br />'. "\n";
    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
      $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= '1' limit 1");
      if ($show_this->RecordCount() > 0) {
        $content .= '<div class="betterCategories"><a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">';
        $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_boxes.gif') . $spacer;
        $content .= CATEGORIES_BOX_HEADING_SPECIALS . '</a></div>';
      }

Owner / Admin
http://www.moebow.com

12 Jan 2012, 7:57 PM
#19
gjh42 avatar

gjh42

Black Belt

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

Re: How to add new link to categories sidebox?

Do you actually have the comment in your file?
// (heres my code)
The // make the entire rest of that line ignored by the processor.

12 Jan 2012, 8:05 PM
#20
bluelightnin6 avatar

bluelightnin6

New Zenner

Join Date:
Dec 2011
Location:
USA
Posts:
77
Plugin Contributions:
0

Re: How to add new link to categories sidebox?

No no just did that so u can see it in orange easily. It really starts at the word "echo" in my file

Owner / Admin
http://www.moebow.com