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![]()
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![]()
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);
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![]()
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);
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![]()
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???![]()
Ok if this is what you have:
You'll need to add the highlighted portions to the code:Code:$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); ?>
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>;
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![]()