Forums / General Questions / How do i add alt text to sidebox images?

How do i add alt text to sidebox images?

Locked

Views: 1,711

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
21 May 2008, 3:05 PM
#1
handcrafteduk avatar

handcrafteduk

Zen Follower

Join Date:
Jul 2006
Posts:
240
Plugin Contributions:
0

How do i add alt text to sidebox images?

Hi,

I am trying to add alt text to the images in my sideboxes but I have no idea how to do it. I imagine it's fairly simple though!!!

My site is here.

Anyone know which files I need to modify (and how!) please?

Many thanks,

gary :smile:

21 May 2008, 6:37 PM
#2
clydejones avatar

clydejones

Deceased

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

Re: How do i add alt text to sidebox images?

HandcraftedUK:

Hi,

I am trying to add alt text to the images in my sideboxes but I have no idea how to do it. I imagine it's fairly simple though!!!

My site is here.

Anyone know which files I need to modify (and how!) please?

Many thanks,

gary :smile:

You need to do two things:

1st

in your language file for the sidebox you need to define your image as follows:

define('LOGO_SIDEBOX_IMAGE_WIDTH', '125');
define('LOGO_SIDEBOX_IMAGE_HEIGHT', '125');
define('LOGO_SIDEBOX_IMAGE', 'test_logo.jpg');
define('LOGO_SIDEBOX_IMAGE_TEXT', 'My Logo'); - this is your alt text

2nd

in your sidebox template file you need to call the image as follows:

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

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

22 May 2008, 9:05 AM
#3
handcrafteduk avatar

handcrafteduk

Zen Follower

Join Date:
Jul 2006
Posts:
240
Plugin Contributions:
0

Re: How do i add alt text to sidebox images?

Hi Clyde,

Thanks for the reply and pointing me in the right direction. although I know what files to edit, I'm not sure how? I would be really grateful if you could give me an example using the image saver3.jpg which is in the discountsidebox (no header on the box) on the right hand side.

Cheers,

gary :smile:

23 May 2008, 4:10 AM
#4
clydejones avatar

clydejones

Deceased

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

Re: How do i add alt text to sidebox images?

HandcraftedUK:

Hi Clyde,

Thanks for the reply and pointing me in the right direction. although I know what files to edit, I'm not sure how? I would be really grateful if you could give me an example using the image saver3.jpg which is in the discountsidebox (no header on the box) on the right hand side.

Cheers,

gary :smile:

Just substitute everything as shown below

1st

in your language file for the sidebox you need to define your image as follows:

define('DISCOUNT_SIDEBOX_IMAGE_WIDTH', '125');
define('DISCOUNT_SIDEBOX_IMAGE_HEIGHT', '125');
define('DISCOUNT_SIDEBOX_IMAGE', 'saver3.jpg');
define('DISCOUNT_SIDEBOX_IMAGE_TEXT', 'My Logo'); - this is your alt text change as you wish.

2nd

in your sidebox template file you need to call the image as follows:

zen_image($template->get_template_dir(DISCOUNT_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . DISCOUNT_SIDEBOX_IMAGE, DISCOUNT_SIDEBOX_IMAGE_TEXT, DISCOUNT_SIDEBOX_IMAGE_WIDTH, DISCOUNT_SIDEBOX_IMAGE_HEIGHT);

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 May 2008, 2:21 PM
#5
handcrafteduk avatar

handcrafteduk

Zen Follower

Join Date:
Jul 2006
Posts:
240
Plugin Contributions:
0

Re: How do i add alt text to sidebox images?

Hi Clyde,

Thanks for the help. I tried that and my sidebox turned blank! I'll copy (below) what wa written in each file:

/public_html/includes/languages/english/extra_definitions/Custom/discount_sidebox_defines.php

define('BOX_HEADING_DISCOUNT_SIDEBOX', ' ');
define('TEXT_DISCOUNT_SIDEBOX', 'Replace this text with your HTML content.');
define('DISCOUNT_SIDEBOX_IMAGE_WIDTH', '125');
define('DISCOUNT_SIDEBOX_IMAGE_HEIGHT', '125');
define('DISCOUNT_SIDEBOX_IMAGE', 'saver3.jpg');
define('DISCOUNT_SIDEBOX_IMAGE_TEXT', 'My Logo');

And in: /public_html/includes/templates/custom/sideboxes/tpl_discount_sidebox.php

/

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

zen_image($template->get_template_dir(DISCOUNT_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . DISCOUNT_SIDEBOX_IMAGE, DISCOUNT_SIDEBOX_IMAGE_TEXT, DISCOUNT_SIDEBOX_IMAGE_WIDTH, DISCOUNT_SIDEBOX_IMAGE_HEIGHT);
?>

Any ideas why it's not working?

Thanks again :smile:

29 May 2008, 2:53 PM
#6
clydejones avatar

clydejones

Deceased

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

Re: How do i add alt text to sidebox images?

HandcraftedUK:

Hi Clyde,

Thanks for the help. I tried that and my sidebox turned blank! I'll copy (below) what wa written in each file:

/public_html/includes/languages/english/extra_definitions/Custom/discount_sidebox_defines.php

define('BOX_HEADING_DISCOUNT_SIDEBOX', ' ');
define('TEXT_DISCOUNT_SIDEBOX', 'Replace this text with your HTML content.');
define('DISCOUNT_SIDEBOX_IMAGE_WIDTH', '125');
define('DISCOUNT_SIDEBOX_IMAGE_HEIGHT', '125');
define('DISCOUNT_SIDEBOX_IMAGE', 'saver3.jpg');
define('DISCOUNT_SIDEBOX_IMAGE_TEXT', 'My Logo');

And in: /public_html/includes/templates/custom/sideboxes/tpl_discount_sidebox.php

/

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

zen_image($template->get_template_dir(DISCOUNT_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . DISCOUNT_SIDEBOX_IMAGE, DISCOUNT_SIDEBOX_IMAGE_TEXT, DISCOUNT_SIDEBOX_IMAGE_WIDTH, DISCOUNT_SIDEBOX_IMAGE_HEIGHT);
?>

Any ideas why it's not working?

Thanks again :smile:

can you post the code for your includes/templates/custom/sideboxes/tpl_discount_sidebox.php

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 May 2008, 4:00 PM
#7
handcrafteduk avatar

handcrafteduk

Zen Follower

Join Date:
Jul 2006
Posts:
240
Plugin Contributions:
0

Re: How do i add alt text to sidebox images?

Hi Clyde,

I think you might have missed it? It was written in the second half of my last post.

Well, I think that's what you wanted??? :smile:

29 May 2008, 4:53 PM
#8
clydejones avatar

clydejones

Deceased

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

Re: How do i add alt text to sidebox images?

HandcraftedUK:

Hi Clyde,

I think you might have missed it? It was written in the second half of my last post.

Well, I think that's what you wanted??? :smile:

Ok if this is what you have:

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

zen_image($template->get_template_dir(DISCOUNT_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . DISCOUNT_SIDEBOX_IMAGE, DISCOUNT_SIDEBOX_IMAGE_TEXT, DISCOUNT_SIDEBOX_IMAGE_WIDTH, DISCOUNT_SIDEBOX_IMAGE_HEIGHT);
?>

You'll need to add the highlighted portions to the code:

$discountimage = zen_image($template->get_template_dir(DISCOUNT_SIDEBOX_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . DISCOUNT_SIDEBOX_IMAGE, DISCOUNT_SIDEBOX_IMAGE_TEXT, DISCOUNT_SIDEBOX_IMAGE_WIDTH, DISCOUNT_SIDEBOX_IMAGE_HEIGHT);
?>;

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

$content .= $discountimage;
$content .= '<div>;

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

5 Jun 2008, 9:46 AM
#9
handcrafteduk avatar

handcrafteduk

Zen Follower

Join Date:
Jul 2006
Posts:
240
Plugin Contributions:
0

Re: How do i add alt text to sidebox images?

HI Clyde,

That didn't seem to work either.

Thanks for trying to help me. I think i'll give up for now though. I can't imagine the missing alt text would affect my search engine rankings too much anyway.

Thanks again :smile: