Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How To Enter Alt. Text in Images?


mbaz2

Recommended Posts

Hi,

 

Ran a search but could not find the answer. How do I enter text for each image? As of now I can

only do this in Define Main Page Section for images on the home page. Where do I enter this

in the Admin area for the other images?

 

Thanks!

Link to comment
Share on other sites

Hi,

 

Ran a search but could not find the answer. How do I enter text for each image? As of now I can

only do this in Define Main Page Section for images on the home page. Where do I enter this

in the Admin area for the other images?

 

Thanks!

 

Any help would be appreciated!

Link to comment
Share on other sites

Which images are you talking about?

 

The tep_image function used to display images takes 5 inputs:

 

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

 

the first and only required is the src of the image, the second is the alt of the image, the third is the width of the image, the fourth is the height and the fifth is additional parameters.

 

so to answer your question to set the alt of an image you'd do something like this:

 

<?php echo tep_image('my_image.jpg', 'This is the Alt tag. I can put whatever I want in here'); ?>

 

Since src is the only required input, the rest are optional ... and we only want to set the alt of the image, so the above will work (even though we're not specifying the width, height and additional parameters)

Link to comment
Share on other sites

Which images are you talking about?

 

The tep_image function used to display images takes 5 inputs:

 

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

 

the first and only required is the src of the image, the second is the alt of the image, the third is the width of the image, the fourth is the height and the fifth is additional parameters.

 

so to answer your question to set the alt of an image you'd do something like this:

 

<?php echo tep_image('my_image.jpg', 'This is the Alt tag. I can put whatever I want in here'); ?>

 

Since src is the only required input, the rest are optional ... and we only want to set the alt of the image, so the above will work (even though we're not specifying the width, height and additional parameters)

 

Thanks for the response! I'm not a programmer so this is a little frustrating.

 

As of now (as per the original developers instructions), I can enter the alt text for images showing in my homepage in the Define Main Page

area in my Admin Panel. So when you right click on the images from the homepage you see the Alternate Text.

 

But all images not on the homepage show "blank" when checking alt text. There does not seem to be a way to enter alt text in the Admin area

for any images not on the homepage.

 

Thanks

Link to comment
Share on other sites

Thanks for the response! I'm not a programmer so this is a little frustrating.

 

As of now (as per the original developers instructions), I can enter the alt text for images showing in my homepage in the Define Main Page

area in my Admin Panel. So when you right click on the images from the homepage you see the Alternate Text.

 

But all images not on the homepage show "blank" when checking alt text. There does not seem to be a way to enter alt text in the Admin area

for any images not on the homepage.

 

Thanks

 

Not sure how your developer designed the site so cant say for sure on how you would go about it ... unless you have some code to show us im pretty much shooting in the dark here .... but the way I showed you before is how you'd enter alt text in images (depending if your developer designed your site properly and used the correct osCommerce functions throughout)

Link to comment
Share on other sites

Hi Slav

can u tell me where to put the Alt text in this case?

is the header.php

 

___________________________________________

<table border="0" width="100%" height="150pix" cellspacing="0" cellpadding="0" >

<tr class="header">

<td valign="middle" width="80%" ></td><td>

 

 

 

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'cabecera_original.gif', 'osCommerce') . '</a>'; ?><br />

 

 

</td>

</tr>

</table>

___________________________________________________

 

Thanks very much!!!

Link to comment
Share on other sites

Hi Slav

can u tell me where to put the Alt text in this case?

is the header.php

 

___________________________________________

<table border="0" width="100%" height="150pix" cellspacing="0" cellpadding="0" >

<tr class="header">

<td valign="middle" width="80%" ></td><td>

 

 

 

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'cabecera_original.gif', 'osCommerce') . '</a>'; ?><br />

 

 

</td>

</tr>

</table>

___________________________________________________

 

Thanks very much!!!

 

In the case above osCommerce is the alt text for the image displayed ... change this bit of code

 

 <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'cabecera_original.gif', 'osCommerce') . '</a>'; ?>

 

to:

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'cabecera_original.gif', 'Alt text in here!!') . '</a>'; ?>

Link to comment
Share on other sites

  • 3 months later...

You edit product_info.php.

 

Find where tep_image occurs in the file and put something in for the second parameter.

 

As you don't say what you want in there can't be any more specific.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • 4 months later...
You edit product_info.php.

 

Find where tep_image occurs in the file and put something in for the second parameter.

 

As you don't say what you want in there can't be any more specific.

Holy thread revival, batman!

 

 

I would like this $products_name to be the alt. How do I put that below? I have tried by the way, and this will go a long way to solving a lot of my other problems.

 

echo '<a href="'.tep_href_link("product_info.php" , $cpath . "&products_id=" . $products_id) . '">' . tep_image(DIR_WS_PRODUCT_IMAGES . $products_image_tumb, "", " ", " ", 'hspace="5" vspace="5"') . '</a>';

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...