Forums / Templates, Stylesheets, Page Layout / Can I add alink in the Categories Sidebox?

Can I add alink in the Categories Sidebox?

Locked

Views: 2,455

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
19 Aug 2008, 3:03 PM
#1
wildfashions avatar

wildfashions

New Zenner

Join Date:
Oct 2007
Posts:
43
Plugin Contributions:
0

Can I add alink in the Categories Sidebox?

I am affilliating with a T Shirt company who are building a site based on my store. What I want to do is add a link to this page/pages in the Categories Sidebox.

Is this possible and if so how do I do it?

Many thanks in advance.

Wild Fashions (Alternative)
Using Zen Cart 1.38 and Purple Lily Template

19 Aug 2008, 4:03 PM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Can I add alink in the Categories Sidebox?

What are you trying to accomplish with the link(s)?

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

19 Aug 2008, 4:05 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Can I add alink in the Categories Sidebox?

Quite possible. There are several ways you could do it; probably the easiest is to add the link directly to your tpl_categories.php with code like this: How do I add additional links to the Header and Footer?
To put the link near the all/featured/new links, add it here:```php
// display a separator between categories and links
if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
$content .= '<hr id="catBoxDivider" />' . "\n";
}
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {

```php
// display a separator between categories and links
    if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
      $content .= '<hr id="catBoxDivider" />' . "\n";
    }
    echo '<a href="http://your_external_link.com">Your Link Text</a><br />'. "\n";
    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
19 Aug 2008, 4:15 PM
#4
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Can I add alink in the Categories Sidebox?

Depending on the goal or use, I was going to suggest either EZ-Pages or the "about us" mod to put the link(s) in a separate box because I'm not sure the info belongs with the categories.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

19 Aug 2008, 4:20 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Can I add alink in the Categories Sidebox?

True ... there are any number of ways the OP's intention could be organized, and knowing the best would require more info than we have.

20 Aug 2008, 4:19 PM
#6
wildfashions avatar

wildfashions

New Zenner

Join Date:
Oct 2007
Posts:
43
Plugin Contributions:
0

Re: Can I add alink in the Categories Sidebox?

OK and thanks for the replies, seems a bit heavy :wacko:

No time at the mo but will try the above options later on.

Its giving me a headache just thinking about it! :lookaroun

Wild Fashions (Alternative)
Using Zen Cart 1.38 and Purple Lily Template

20 Aug 2008, 4:29 PM
#7
wildfashions avatar

wildfashions

New Zenner

Join Date:
Oct 2007
Posts:
43
Plugin Contributions:
0

Re: Can I add alink in the Categories Sidebox?

Sorry should have added:

The only goal I require is that I can place a link in the Categories sidebox to an external web page.

Wild Fashions (Alternative)
Using Zen Cart 1.38 and Purple Lily Template

20 Aug 2008, 4:49 PM
#8
wildfashions avatar

wildfashions

New Zenner

Join Date:
Oct 2007
Posts:
43
Plugin Contributions:
0

Re: Can I add alink in the Categories Sidebox?

OK and again thanks for your quick replies.

Decided to use ezpages to acomplish this. I would have preferred the link in the categories sidebox but this is just as good. Renamed the sidebox to T Shirts and set the order for it to be just below the categories sidebox.

Thanks

Wild Fashions (Alternative)
Using Zen Cart 1.38 and Purple Lily Template

13 Sep 2008, 1:04 PM
#9
dimar avatar

dimar

New Zenner

Join Date:
Feb 2007
Posts:
76
Plugin Contributions:
0

Re: Can I add alink in the Categories Sidebox?

Hello,

I wanted to do the same thing and came up with the following, perhaps it works for you too:

first of all, find tpl_header.php from the includes/templates/template_default/sideboxes folder

open it and add the following code

 
$content .= '<a class="category-external" href="http://URL">EXTERNAL</a>' . "\n";
 

after line 14 for a link above the menu (like this:)

 
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
  $content .= '<a class="category-external" href="http://yourexternalURL">EXTERNALTOP</a>' . "\n";
  for ($i=0;$i<sizeof($box_categories_array);$i++) {
 
 

and the same after line 61 for one on the bottom (like this:)

 
 
 $content .= '<br />' . "\n";
    }
  }
$content .= '<a class="category-external" href="http://yourexternalURL">EXTERNALBOTTOM</a>' . "\n"; 
  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
 

Hope this helps, let us know!

DMR

14 Dec 2010, 10:26 AM
#10
first_action avatar

first_action

New Zenner

Join Date:
Jan 2010
Posts:
16
Plugin Contributions:
0

Re: Can I add alink in the Categories Sidebox?

Hi, I hope this thread is still running.

I want to do something similiar, but if I change the code using one of the ways suggested, will it affect the way the rest of my store functions?

I want all my categories to act as normal but then have 1 or 2 link to an affiliate site when clicked on, such amazon.

Is this possible?

I've seen that i can do it for products by changing them to general-document, but want to be able to link straight fromt eh categorie title.

Thanks

I love helpful zenners, you guys rock!
First Action Self Defense: Much More Than Fighting
Highly Recommended Products and Survices

14 Dec 2010, 3:59 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Can I add alink in the Categories Sidebox?

If you want to insert external links at various places in the list of categories, the best way would be to install Categories Dressing from Free Addons, and make "headings" that have your link content. They can be styled to look like your other links, or whatever you want (somehow different would be best, to alert customers that they are going off your site).