Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

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

    Quote Originally Posted by HandcraftedUK View Post
    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);

  3. #3
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

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

    Quote Originally Posted by HandcraftedUK View Post
    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);

  5. #5
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default 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

  6. #6
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

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

    Quote Originally Posted by HandcraftedUK View Post
    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
    can you post the code for your includes/templates/custom/sideboxes/tpl_discount_sidebox.php

  7. #7
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default 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???

  8. #8
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

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

    Quote Originally Posted by HandcraftedUK View Post
    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:

    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);
    ?>
    You'll need to add the highlighted portions to the code:

    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>;

  9. #9
    Join Date
    Jul 2006
    Posts
    248
    Plugin Contributions
    0

    Default 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

 

 

Similar Threads

  1. Replies: 2
    Last Post: 3 Sep 2013, 10:19 PM
  2. How do I get rid of IH2 ALT text over images?
    By PUREchocolatetruffle in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Sep 2010, 03:58 PM
  3. How to Add Alt Text to Images in a Sidebox?
    By ScriptJunkie in forum General Questions
    Replies: 8
    Last Post: 12 Sep 2008, 06:09 AM
  4. Replies: 3
    Last Post: 30 Jul 2008, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg