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 21 to 26 of 26
12 Jan 2012, 8:14 PM
#21
gjh42 avatar

gjh42

Black Belt

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

How to add new link to categories sidebox?

Here's the problem... betterCategories uses an accumulator variable $content instead of directly echoing the output as the original tpl_categories.php does. So you want ```php
$content .= '<br />' . zen_draw_separator('pixel_silver.gif') . '<br />';
}
$content .= '<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

You will currently have a FREE Products link somewhere else on your page.
12 Jan 2012, 9:50 PM
#22
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?

well that KINDA worked. its on there now but it doesn't look right at all. its much further left than the other text there and its missing my arrow image..

EDIT:

I did manage to get the arrow image in there, but its in the wrong spot as well and also when i hover over the link it does not light up the background of the text maroon like my other 3 do?? omg this is so aggrivating. i thank you so much for your patience

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

12 Jan 2012, 9:57 PM
#23
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?

Ok forget that whollle poste I fixed almost all of that with entering this code :

   $content .= '<div class="betterCategories"><a class="category-links" href="http://www.moebow.com/index.php?main_page=index&cPath=25_60">';
        $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_boxes.gif') . $spacer;
    $content .= CATEGORIES_BOX_HEADING_FREE . '</a></div>';

Now I just need to know where to change the heading because it shows up as the "CATEGORIES_BOX_HEADING_FREE " I know its a language file but which one? and what exactly do i add?

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

12 Jan 2012, 10:09 PM
#24
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?

FIXED!!! I'm so proud of myself! lol Thanks so much for your help gjh42! Maybe one day I too will be a black belt in Zen :bigups:

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

12 Jan 2012, 10:14 PM
#25
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?

For anyone else wondering how to fix this I just added to the include/language/my template/english file

BEFORE

// categories box text in sideboxes/categories.php

  define('BOX_HEADING_CATEGORIES', 'Categories');

AFTER

// categories box text in sideboxes/categories.php

  define('BOX_HEADING_CATEGORIES', 'Categories');

  define('CATEGORIES_BOX_HEADING_FREE', 'FREE Products...');

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

12 Jan 2012, 10:15 PM
#26
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?

Look for a language file in the betterCategories mod package - that will be the one to add your new define to. Something like

define('CATEGORIES_BOX_HEADING_FREE', 'Free Products');

Also, you don't need the full URL:

href="http://www.moebow.com/index.php?main_page=index&cPath=25_60"

A relative URL will allow the code to be portable to a test installation:

href="index.php?main_page=index&cPath=25_60"
[/php]

The english.php location will work, though the dedicated sidebox file is a better location for maintainability.