Zen Cart Logo
Forums / Addon Sideboxes / How to put a link in an additionnal sidebox with a logo

How to put a link in an additionnal sidebox with a logo

Locked

Views: 4,508

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
6 Nov 2007, 2:26 AM
#1
chrismonroe avatar

chrismonroe

New Zenner

Join Date:
Aug 2007
Posts:
20
Plugin Contributions:
0

How to put a link in an additionnal sidebox with a logo

I installed the add on "logo sidebox".

I put a picture in my sidebox and would like to know which line of codes inside the "tpl_logo_sidebox.php" file do I have to edit to put a link to a page of my site.

Thanks for your help.

Chris :hug:

6 Nov 2007, 3:49 AM
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

chrismonroe:

I installed the add on "logo sidebox".

I put a picture in my sidebox and would like to know which line of codes inside the "tpl_logo_sidebox.php" file do I have to edit to put a link to a page of my site.

Thanks for your help.

Chris :hug:

You need to edit two files:
#1 -
includes/languages/extra/definitions/logo_sidebox_defines.php

Find these lines of code and edit as necessary

//this is optional if you want to use the logo as a link
//replace your_link.com with the link you choose
define('LOGO_SIDEBOX_LINK', 'http://your_link.com/');

#2 -

includes/templates/YOUR_TEMPLATE/sideboxes/tpl_logo_sidebox.php

right at the top of the file you will find these instructions:

// Link Option - uncomment this if you intend to use the logo as a link
//$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . '">' . zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT) . '</a>';

//comment this out if you use the above link option.
$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

Just follow the instructions: comment out the line you won't be using and uncomment the line you will be using.

8 Nov 2007, 3:48 AM
#3
chrismonroe avatar

chrismonroe

New Zenner

Join Date:
Aug 2007
Posts:
20
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

In fact before asking this question, I reached the point you ve described.

I put my link in the file #1

but I didn t know which line of codes to uncomment and comment out in the file #2

A programmer took a look to the file #2 and removed only some "" that were redundant (I don t know which one), didn t uncomment or comment out anything and it worked.

There must be a small mistake in the codes.

Thanks a lot for having taken the time to answer me clydejones. :hug:

Chris

8 Nov 2007, 4:22 AM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

chrismonroe:

In fact before asking this question, I reached the point you ve described.

I put my link in the file #1

but I didn t know which line of codes to uncomment and comment out in the file #2

A programmer took a look to the file #2 and removed only some "" that were redundant (I don t know which one), didn t uncomment or comment out anything and it worked.

There must be a small mistake in the codes.

Thanks a lot for having taken the time to answer me clydejones. :hug:

Chris

Can you post the changes your "programmer" made to tpl_logo_sidebox.php, I'd like to see what was done. Thanks

8 Nov 2007, 6:04 PM
#5
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

Hi,

I don't seem to be able to get the image to come up. In the first file I have given the url/path to the image file along with a text to display. The text displays fine but the image does not.

define('BOX_HEADING_LOGO_SIDEBOX', '');
define('LOGO_SIDEBOX_IMAGE_WIDTH', '125');
define('LOGO_SIDEBOX_IMAGE_HEIGHT', '125');
define('LOGO_SIDEBOX_IMAGE', 'http://www.tranquillas.com/biz/includes/templates/tranquillas/images/Omega Skull.gif');
define('LOGO_SIDEBOX_IMAGE_TEXT', 'Tranquilla's');

I have verified that the path to the image is correct but can't get it to display. One the second file I tried things both ways and it did not seem to have an effect on the image displaying.

At this point I figure that it must be something dumb (smile)... so can someone nudge my brain in a direction?

9 Nov 2007, 12:24 AM
#6
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

crabdance:

Hi,

I don't seem to be able to get the image to come up. In the first file I have given the url/path to the image file along with a text to display. The text displays fine but the image does not.

I have verified that the path to the image is correct but can't get it to display. One the second file I tried things both ways and it did not seem to have an effect on the image displaying.

At this point I figure that it must be something dumb (smile)... so can someone nudge my brain in a direction?

You only need to define the image name as indicated by the highlighted portion.

define('BOX_HEADING_LOGO_SIDEBOX', '');
define('LOGO_SIDEBOX_IMAGE_WIDTH', '125');
define('LOGO_SIDEBOX_IMAGE_HEIGHT', '125');
define('LOGO_SIDEBOX_IMAGE', 'Omega Skull.gif');
define('LOGO_SIDEBOX_IMAGE_TEXT', 'Tranquilla's');

The following statement in the second file takes care of locating the correct path to the image:

$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

9 Nov 2007, 1:40 AM
#7
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

Well, it was as simple as that. Once I took out the hard coded path to the image file, everything worked fine and dandy. Thank you for helping me with the picture box. You have a great evening.

9 Nov 2007, 5:29 AM
#8
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

crabdance:

Well, it was as simple as that. Once I took out the hard coded path to the image file, everything worked fine and dandy. Thank you for helping me with the picture box. You have a great evening.

Glad its working and always glad to help

12 Nov 2007, 7:36 PM
#9
chrismonroe avatar

chrismonroe

New Zenner

Join Date:
Aug 2007
Posts:
20
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

clydejones:

Can you post the changes your "programmer" made to tpl_logo_sidebox.php, I'd like to see what was done. Thanks

Here is the file transformed by the programmer :

// Link Option - uncomment this if you intend to use the logo as a link
$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . '">' . zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT) . '</a>';

//comment this out if you use the above link option.
//$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '">';

$content .= $logoimage;

$content .= '</div>';
?>

12 Nov 2007, 7:57 PM
#10
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

chrismonroe:

Here is the file transformed by the programmer :

he did exactly what was required by the instructions

He uncommented one line of code and commented out the other.

21 Sep 2008, 7:56 PM
#11
gizmo_girl avatar

gizmo_girl

Zen Follower

Join Date:
Nov 2007
Location:
Texas
Posts:
286
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

Clyde,
I'm having a problem with my logo sidebox & I'm hoping you can help.

First of all, I have been trying to change NOTICES & ANNOUNCEMENTS (the sidebox heading) to say SEE WHAT'S NEW. Should be simple enough, but every time I change the wording, I get a parse error and it disables the whole site.

I've been changing it in the logo_sidebox_defines.php file here:

define('BOX_HEADING_LOGO_SIDEBOX', 'NOTICES & ANNOUNCEMENTS');

The next problem is making the image work as a link. Here's what I have in the different files.

logo_sidebox_defines.php:

define('BOX_HEADING_LOGO_SIDEBOX', 'NOTICES & ANNOUNCEMENTS');
define('LOGO_SIDEBOX_IMAGE_WIDTH', '125');
define('LOGO_SIDEBOX_IMAGE_HEIGHT', '150');
define('LOGO_SIDEBOX_IMAGE', 'peek.gif');
define('LOGO_SIDEBOX_IMAGE_TEXT', 'Pet Tag Previewer');

//this is optional if you want to use the logo as a link
//replace your_link.com with the link you choose
define('LOGO_SIDEBOX_LINK', 'http://www.kings-kreations.com/previewer');

?>

and in tpl_logo_sidebox.php I have this:

$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . 'http://www.kings-kreations.com/previewer">' . zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT) . '</a>';

//comment this out if you use the above link option.
$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '">';

$content .= $logoimage;

$content .= '</div>';
?>

WHAT am I missing?? :dontgetit

TIA,
Mindy

21 Sep 2008, 8:05 PM
#12
gizmo_girl avatar

gizmo_girl

Zen Follower

Join Date:
Nov 2007
Location:
Texas
Posts:
286
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

Clyde,
I'm having a problem with my logo sidebox & I'm hoping you can help.

First of all, I have been trying to change NOTICES & ANNOUNCEMENTS (the sidebox heading) to say SEE WHAT'S NEW. Should be simple enough, but every time I change the wording, I get a parse error and it disables the whole site.

I've been changing it in the logo_sidebox_defines.php file here:

define('BOX_HEADING_LOGO_SIDEBOX', 'NOTICES & ANNOUNCEMENTS');

The next problem is making the image work as a link. Here's what I have in the different files.

logo_sidebox_defines.php:

define('BOX_HEADING_LOGO_SIDEBOX', 'NOTICES & ANNOUNCEMENTS');
define('LOGO_SIDEBOX_IMAGE_WIDTH', '125');
define('LOGO_SIDEBOX_IMAGE_HEIGHT', '150');
define('LOGO_SIDEBOX_IMAGE', 'peek.gif');
define('LOGO_SIDEBOX_IMAGE_TEXT', 'Pet Tag Previewer');

//this is optional if you want to use the logo as a link
//replace your_link.com with the link you choose
define('LOGO_SIDEBOX_LINK', 'http://www.kings-kreations.com/previewer');

?>

and in tpl_logo_sidebox.php I have this:

$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . 'http://www.kings-kreations.com/previewer">' . zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT) . '</a>';

//comment this out if you use the above link option.
$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '">';

$content .= $logoimage;

$content .= '</div>';
?>

WHAT am I missing?? :dontgetit

TIA,
Mindy

21 Sep 2008, 8:40 PM
#13
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

gizmo_girl:

Clyde,
I'm having a problem with my logo sidebox & I'm hoping you can help.

First of all, I have been trying to change NOTICES & ANNOUNCEMENTS (the sidebox heading) to say SEE WHAT'S NEW. Should be simple enough, but every time I change the wording, I get a parse error and it disables the whole site.

I've been changing it in the logo_sidebox_defines.php file here:

define('BOX_HEADING_LOGO_SIDEBOX', 'NOTICES & ANNOUNCEMENTS');

The next problem is making the image work as a link. Here's what I have in the different files.

logo_sidebox_defines.php:

define('BOX_HEADING_LOGO_SIDEBOX', 'NOTICES & ANNOUNCEMENTS');
define('LOGO_SIDEBOX_IMAGE_WIDTH', '125');
define('LOGO_SIDEBOX_IMAGE_HEIGHT', '150');
define('LOGO_SIDEBOX_IMAGE', 'peek.gif');
define('LOGO_SIDEBOX_IMAGE_TEXT', 'Pet Tag Previewer');

//this is optional if you want to use the logo as a link
//replace your_link.com with the link you choose
define('LOGO_SIDEBOX_LINK', 'http://www.kings-kreations.com/previewer');

?>

and in tpl_logo_sidebox.php I have this:

$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . 'http://www.kings-kreations.com/previewer">' . zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT) . '</a>';

//comment this out if you use the above link option.
$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '">';

$content .= $logoimage;

$content .= '</div>';
?>

WHAT am I missing?? :dontgetit

TIA,
Mindy

I get a parse error and it disables the whole site.

What exactly does the error message say?

Remember that ALL Upper case is a constant - so what you've done is define one constant to reference another constant which does not exist.

Try making define Notices & Announcements and see if that eliminates the parse error.

If you want it to be uppercase add this declaration to your stylesheet

h3#logosideboxHeading {
text-transform: uppercase;
}

$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . 'http://www.kings-kreations.com/previewer">' .

You don't need the highlighted portion in this section of the code.

21 Sep 2008, 9:10 PM
#14
gizmo_girl avatar

gizmo_girl

Zen Follower

Join Date:
Nov 2007
Location:
Texas
Posts:
286
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

I tried typing 'See What's New' in place of 'NOTICES & ANNOUNCEMENTS' (which has been working just fine) and this is the error message I get:

Parse error: syntax error, unexpected T_STRING in /home3/mindy/kings-kreations-www/zen/includes/languages/english/extra_definitions/logo_sidebox_defines.php on line 27

Line 27 is:
define('BOX_HEADING_LOGO_SIDEBOX', 'See What's New!');

21 Sep 2008, 9:24 PM
#15
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

gizmo_girl:

I tried typing 'See What's New' in place of 'NOTICES & ANNOUNCEMENTS' (which has been working just fine) and this is the error message I get:

Parse error: syntax error, unexpected T_STRING in /home3/mindy/kings-kreations-www/zen/includes/languages/english/extra_definitions/logo_sidebox_defines.php on line 27

Line 27 is:
define('BOX_HEADING_LOGO_SIDEBOX', 'See What's New!');

Line 27 is:
define('BOX_HEADING_LOGO_SIDEBOX', 'See What's New!');

add the highlighted character as indicated and see if that eliminates the error message.

21 Sep 2008, 9:25 PM
#16
gizmo_girl avatar

gizmo_girl

Zen Follower

Join Date:
Nov 2007
Location:
Texas
Posts:
286
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

In tpl_logo_sidebox.php, I have the following (removed the http://www.kings-kreations.com/preview), but it still doesn't work. I'm certain I'm missing something very simple, I just can't figure out what it is...

// Link Option - uncomment this if you intend to use the logo as a link
$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . '">' . zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT) . '</a>';

//comment this out if you use the above link option.
$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '">';

$content .= $logoimage;

$content .= '</div>';
?>

21 Sep 2008, 9:30 PM
#17
gizmo_girl avatar

gizmo_girl

Zen Follower

Join Date:
Nov 2007
Location:
Texas
Posts:
286
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

Line 27 is:
define('BOX_HEADING_LOGO_SIDEBOX', 'See What's New!');

add the highlighted character as indicated and see if that eliminates the error message.

WOW, that's amazing that one.little.character can disable an entire web site. That worked perfectly! THANKS!

21 Sep 2008, 9:53 PM
#18
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

gizmo_girl:

In tpl_logo_sidebox.php, I have the following (removed the http://www.kings-kreations.com/preview), but it still doesn't work. I'm certain I'm missing something very simple, I just can't figure out what it is...

// Link Option - uncomment this if you intend to use the logo as a link
$logoimage = '<a href="' . LOGO_SIDEBOX_LINK . '">' . zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT) . '</a>';

//comment this out if you use the above link option.
//$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '">';

$content .= $logoimage;

$content .= '</div>';
?>

define('LOGO_SIDEBOX_LINK', 'http://www.kings-kreations.com/previewer" target="_blank');

//comment this out if you use the above link option.
//$logoimage = zen_image($template->get_template_dir(LOGO_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX_IMAGE, LOGO_SIDEBOX_IMAGE_TEXT);

Don't forget to comment out this section as indicated by the highlighted backslashes

21 Sep 2008, 10:09 PM
#19
gizmo_girl avatar

gizmo_girl

Zen Follower

Join Date:
Nov 2007
Location:
Texas
Posts:
286
Plugin Contributions:
0

Re: How to put a link in an additionnal sidebox with a logo

Once again, you are the MASTER at figuring these things out! THANK YOU SO MUCH!!

21 Sep 2008, 10:17 PM
#20
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How to put a link in an additionnal sidebox with a logo

gizmo_girl:

Once again, you are the MASTER at figuring these things out! THANK YOU SO MUCH!!

glad to help