Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Have a category link to an external link

Have a category link to an external link

Views: 711

Results 1 to 4 of 4
16 Aug 2013, 4:40 PM
#1
happangl7 avatar

happangl7

New Zenner

Join Date:
Aug 2013
Posts:
12
Plugin Contributions:
0

Have a category link to an external link

Hi all,

I want to have one of the categories in my left sidebar link to an external page. specifically I'd like "scent guide" to be able to link to "www.earthlybody.com/scent-guide.html" Would anyone know which file I have to edit to do this? I've already looked at tpl_categories.php and I can't seem to find where this one link is.

link to website: www.earthlybody.com/shop

Any help would be greatly appreciated.

Thanks

16 Aug 2013, 5:09 PM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Have a category link to an external link

happangl7:

Hi all,

I want to have one of the categories in my left sidebar link to an external page. specifically I'd like "scent guide" to be able to link to "www.earthlybody.com/scent-guide.html" Would anyone know which file I have to edit to do this? I've already looked at tpl_categories.php and I can't seem to find where this one link is.

link to website: www.earthlybody.com/shop

Any help would be greatly appreciated.

Thanks

It can be done, open:
/includes/templates/YOUR_TEMPLATE_NAME/sideboxes/tpl_categories.php

or copy tpl_categories.php from ( /includes/templates/template_default/sideboxes/ ) to above location

Find:

        // skip if this is for the document box (==3)
      } else {
      $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';

Replace with:

        // skip if this is for the document box (==3)
      } else {

if ($box_categories_array[$i]['path'] == 'cPath=6') {
      $content .= '<a class="' . $new_style . '" href="' . HTTP_SERVER . DIR_WS_CATALOG . 'scent-guide.html' . '">';
      } else {
      $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
}

Good luck!

16 Aug 2013, 6:50 PM
#3
happangl7 avatar

happangl7

New Zenner

Join Date:
Aug 2013
Posts:
12
Plugin Contributions:
0

Re: Have a category link to an external link

rbarbour:

It can be done, open:
/includes/templates/YOUR_TEMPLATE_NAME/sideboxes/tpl_categories.php

or copy tpl_categories.php from ( /includes/templates/template_default/sideboxes/ ) to above location

Find:

    // skip if this is for the document box (==3)
  } else {
  $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
> 
> Replace with:
> ```php
        // skip if this is for the document box (==3)
      } else {

if ($box_categories_array[$i]['path'] == 'cPath=6') {
      $content .= '<a class="' . $new_style . '" href="' . HTTP_SERVER . DIR_WS_CATALOG . 'scent-guide.html' . '">';
      } else {
      $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
}

Good luck!

Thanks! That worked perfectly :)

16 Aug 2013, 7:08 PM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Have a category link to an external link

Glad it worked for you!