Forums / Templates, Stylesheets, Page Layout / add a logo as a link to a sidebox?

add a logo as a link to a sidebox?

Locked

Started by artifaxworthing on 13 May 2010, 8:06 AM · Views: 1,534

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
13 May 2010, 8:06 AM
#1
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

add a logo as a link to a sidebox?

I am using a blank sidebox and I want to add an image as a link to an external website.

How can I do this???

https://www.artifaxonline.co.uk/t-shirts

13 May 2010, 9:15 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: add a logo as a link to a sidebox?

Your code looks right, except you missed the closing > in the </a> tag. It may also be that the image isn't where it's supposed to be. Once those are fixed, and it still doesn't work, try an absolute path to the image (http:// )

15 May 2010, 3:38 PM
#3
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

HI
its still not working where do we put the absolute path?

thanks

16 May 2010, 1:00 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: add a logo as a link to a sidebox?

Same place you had the original href code. You've removed it, so I can't see exactly what you may have done.

Here's the code from my blank sidebox-with-an-image-link-to-facebook:

define('TEXT_LOGO2_SIDEBOX', '<a href="http://www.facebook.com/pages/Chief-Okemos-Sportsmans-Club/310761025377"><img src="includes/templates/cosc/images/facebook.gif"></img></a>');

Facebook.gif is an image I created.

17 May 2010, 12:37 PM
#5
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

hi I have re-inserted the code in the includes/languages/extra_definitions/blank_sidebox_defines.php and the image into the images folder but i still cant seem to make this a link is there somewhere else that we need to put the code?

17 May 2010, 1:07 PM
#6
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: add a logo as a link to a sidebox?

Nope. Should work there. You can also insert the code in tpl_blank_sidebox.php.

When you say 'can't seem to make this a link', do you mean the image is there but isn't clickable?

Maybe if you post the code here, we might be able to spot something.

17 May 2010, 1:11 PM
#7
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

the code is as i written it and the image appears on the website but its not clickable.
http://artifaxonline.co.uk/t-shirts

17 May 2010, 2:29 PM
#8
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: add a logo as a link to a sidebox?

I'm not seeing an <a href= ... in the source for that box, which you'll need to make it a link.

It looks like you put the image in the sidebox heading - might be better to turn the heading off and put the image in the body of the sidebox.

18 May 2010, 10:40 AM
#9
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

sorry ! we are still very confused :frusty: this is what the code looks like that we have put in this page we have also put the image which I have named facebook.gif in the images file.

Is it because of the name of the sidebox? or is it that we need to put this anywhere else? if we put it in the tpl_blank_sidebox.php we loose the whole box! are we putting in the wrong code for the wrong page?

http://artifaxonline.co.uk/t-shirts

blank_sidebox_defines.php( looks like this is this page)

<?php /** * blank sidebox definitions - text for inclusion in a new blank sidebox * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ */ define('BOX_HEADING_BLANK_SIDEBOX', 'facebook.gif'); define('TEXT_BLANK_SIDEBOX', '<a href="http://www.facebook.com/pages/artifaxworthing/724fdcbd44d05d0c474160a28ee90faf"><img src="includes/templates/pc01/images/facebook.gif"></img></a>'); ?>
18 May 2010, 11:33 AM
#10
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: add a logo as a link to a sidebox?

Sorry, but I'm still not seeing that anchor code in your source code for the page, and, according to that code, the image should show in both the heading and the content of that box, and it isn't.

Did you save the edited file to the correct override directory (includes/languages/english/extra_definitions/PC01) ?

18 May 2010, 12:56 PM
#11
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

:smile::smile: we now have it working by using a logo sidebox, what code do we need to add/change to have this opening in a new window??

thanks for your help :D:D

18 May 2010, 12:57 PM
#12
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

sorry also how do we duplicate this box for another link?

18 May 2010, 12:59 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: add a logo as a link to a sidebox?

Inside the <a href> tag, add another attribute target="_blank".

To duplicate the sidebox, clone all of the files, renaming with a 2 or something added to the name. Change all filename references accordingly.

If you just want a second link in the same location, you can add the code to the sidebox you have.

24 May 2010, 11:41 AM
#14
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

hi thankyou i have duplicated the logo box and called it logo_sidebox_defines2.php placed the new image in the images folder and changed the file titles and images for the new link, but unfortunately its still picking up the image and link for the facebook have i missed something out?
http://www.artifaxonline.co.uk/t-shirts

thanks again for your help

24 May 2010, 1:00 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: add a logo as a link to a sidebox?

You must have some variables or constants in logosidebox2 that are the same as the ones in logosidebox, or perhaps some filename references inside files that have not been updated. We can't tell what ones without seeing all the PHP files.

If you want the second link below the first one, you are wasting effort by making a second sidebox. Just add the second link code to the original box files.

24 May 2010, 2:27 PM
#16
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

Hi

If i copy the code and place it below the other link I either loose all the links or the facebook still stays but without the twitter.

I have tried again to duplicate the logo code and called it 2 but now the twitter link shows and not the facebook!!:frusty:
http://www.artifaxonline.co.uk/t-shirts

tpl.logo_sidebox2.php
Link Option - uncomment this if you intend to use the logo as a link
$logoimage = '<a href="' . LOGO_SIDEBOX2_LINK . '">' . zen_image($template->get_template_dir(LOGO_SIDEBOX2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX2_IMAGE, LOGO_SIDEBOX2_IMAGE_TEXT) . '</a>';

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

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

$content .= $logoimage;

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

define('BOX_HEADING_LOGO_SIDEBOX', '');
define('LOGO_SIDEBOX_IMAGE_WIDTH', '170');
define('LOGO_SIDEBOX_IMAGE_HEIGHT', '40');
define('LOGO_SIDEBOX_IMAGE', 'twitterbutton.gif');
define('LOGO_SIDEBOX_IMAGE_TEXT', 'Link to twitter');

//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.twitter.com/artifaxworthing');

?>

the code for the facebook is minus the number 2!

24 May 2010, 9:35 PM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: add a logo as a link to a sidebox?

All of your defines refer to logo_sidebox constants. As I said, you need to convert ALL of them to the new name, like BOX_HEADING_LOGO_SIDEBOX2.

The "Link option" text is just a comment, and must remain commented or it will be treated as code and cause some form of error or incorrect performance.

Since both files use the $logoimage variable, the uncommented comment in the logo_sidebox2 code invalidates the statement and the variable keeps the value it had in the first sidebox.

24 May 2010, 9:46 PM
#18
gjh42 avatar

gjh42

Black Belt

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

Re: add a logo as a link to a sidebox?

When you add the second link code, you need to use mostly all new constants and variables (except for $content), and you do not duplicate the $content = ''; which wipes the variable clean.

Also, none of the $content statements should be in a define file. They will not be able to function correctly there. They belong in module or template files.

24 May 2010, 10:17 PM
#19
bigal49 avatar

bigal49

Zen Follower

Join Date:
Mar 2010
Location:
California
Posts:
236
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

Here is the code I used to get mine to show.

Renam ALL instances of "BLANK" to "??"

In all 3 files

define('BOX_HEADING_AM_SIDEBOX', 'American Made');
define('TEXT_AM_SIDEBOX', 'We are proud to say <br> everything we sell at <br><em><strong>Topnotch Bass Baits</strong>
</em> <br> is made in the <img src="http://xxx.xxx.xxx.xx/~zzzzzz/images/flag.jpg" /> ');

Hope it helps.

Big Al

BigAl49
Al Treadway
http://www.topnotchbassbaits.com

25 May 2010, 11:35 AM
#20
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: add a logo as a link to a sidebox?

Hi thank you to all that have helped with this dreaded link sidebox :smile: we have now cracked it !! now we need these links to open in a separate window so you do not navigate away from our site

thank you for the code target="_blank" but we are unsure where it needs to go we have tried putting it in a few places but either get another line of text with that wording or we loose everything again:frusty: here is the line of text we think it goes into but where?

$logoimage = '<a href="' . LOGO_SIDEBOX2_LINK . '">' . zen_image($template->get_template_dir(LOGO_SIDEBOX2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . LOGO_SIDEBOX2_IMAGE, LOGO_SIDEBOX2_IMAGE_TEXT). '</a>';

(this code is from tpl_logo_sidebox2.tpl)