Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 01-29-2005 17:13:37

morvak
Member
Registered: 11-02-2003
Posts: 96
Website

Add Alt Attribute To Images!

[size=8]I'm sure this already has been posted, but what the hell. besides, i want to contribute something to this great software![/size]

Now you can help your search engine rankings and even overall usability of your cart by putting the ALT tag to use in the product images! Now your images, whether in category or detailed display will contain product name, a short description or even certain keywords!

Here's all you have to do:

Simply open up your ste_prod.pl and simply look for all instances of:



and change to:



You are simply adding

Now, when a user hovers the mouse over your product image, anywhere in your cart (category, specials, detail) the product name will pop up!

If you want to really get fancy, replace

with  or  or even  !

I personally use $product_descshort because I can put the product name in with some product related keywords to help with the search engines. This is the product short description. Plus, this also helps in overall site usability and blah blah.

You can see this in action  just hover your mouse over the images

Offline

 

#2 01-29-2005 20:01:16

steveblueradio
Member
From: Belfast, Northern Ireland
Registered: 06-28-2004
Posts: 755
Website

Re: Add Alt Attribute To Images!

This is a really good mod, but  the alt tags only show in IE, if you want the text to display in firefox elc, you will need to use the title tag as well.
like so:

<IMG SRC=\"$images_path/product_detail/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\"BORDER=\"0\">";

Cheers ;-) ,
Steve


I'm Gene Hunt, Your DCI, And it's 1973, Nearly Dinner Time, I'm havin hoops........

Cheers,
Steve
-------------------

Offline

 

#3 01-29-2005 21:10:40

morvak
Member
Registered: 11-02-2003
Posts: 96
Website

Re: Add Alt Attribute To Images!

kudos for that! i actually did some research after my post and tried it out in firefox and ... well... TITLE tag it is ;-)

Offline

 

#4 01-30-2005 22:27:36

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Add Alt Attribute To Images!

Am I missing something here?

You guys have done this to the "none.gif" image call which is done when there is no image available to display for a product.

I would:

1. Change back all those references to their original configuration.

2. Go into Admin/HTML Pages and Elements and do this in Category Listing Displays then Category Product Displays then Product Detail Displays.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#5 02-01-2005 16:56:17

CityWebSystems.com
Member
From: Utah
Registered: 03-12-2004
Posts: 95
Website

Re: Add Alt Attribute To Images!

Sorry blade, it can't be done in the Pages and Elements section for the product and category images. It must be done in the modules. I've been doing this mod ever since I found CCP.

In ste_prod.pl make your image print statments look like this:

Code:

#######################
# Ste Prod Show Image #
#######################
print "<IMG SRC=\"$images_path/product_category/$image_name\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_small_image_width\" BORDER=\"0\">";

print "<IMG SRC=\"$images_path/product_category/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_small_image_width\" BORDER=\"0\">";

##############################
# Ste Prod Show Image Detail #
##############################

print "<IMG SRC=\"$images_path/product_detail/$imglg\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";

print "<IMG SRC=\"$images_path/product_detail/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";

In ste_cat.pl make your image print statments look like this:

Code:

######################
# Ste Cat Show Image #
######################

print "<IMG SRC=\"$images_path/category/$image_name\" ALT=\"$category_name\" TITLE=\"$category_name\"  WIDTH=\"$store_cat_image_width\" BORDER=\"0\">";

print "<IMG SRC=\"$images_path/category/none.gif\" ALT=\"$category_name\" TITLE=\"$category_name\" WIDTH=\"$store_cat_image_width\" BORDER=\"0\">";

As morvak said, you can use ,  or  if you like as the alt and title attributes. Oh, and yeah... gotta' love the way IE screws up the use of the ALT attribute by making the ALT text be displayed as a tooltip.  sad You'd think M$ had never heard of the W3C!

Offline

 

#6 02-01-2005 19:27:13

pookie
Member
Registered: 11-03-2004
Posts: 57

Re: Add Alt Attribute To Images!

Thanks CityWeb.

The first part works fine for the products, but the second part:

Code:

######################
# Ste Cat Show Image #
######################

print "<IMG SRC=\"$images_path/category/$image_name\" ALT=\"$product_name\" TITLE=\"$product_name\"  WIDTH=\"$store_cat_image_width\" BORDER=\"0\">";

print "<IMG SRC=\"$images_path/category/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_cat_image_width\" BORDER=\"0\">";

is not showing the cat names.

Any ideas?

Thank you again.

Offline

 

#7 02-02-2005 12:22:30

CityWebSystems.com
Member
From: Utah
Registered: 03-12-2004
Posts: 95
Website

Re: Add Alt Attribute To Images!

pookie,02/01/2005 07:27:13 PM wrote:

Thanks CityWeb.

The first part works fine for the products, but the second part is not showing the cat names.

Any ideas?

Thank you again.

Ooops! Sorry... here is the correct code. I have fixed my previous post as well.

In ste_cat.pl make your image print statments look like this:

Code:

######################
# Ste Cat Show Image #
######################

print "<IMG SRC=\"$images_path/category/$image_name\" ALT=\"$category_name\" TITLE=\"$category_name\"  WIDTH=\"$store_cat_image_width\" BORDER=\"0\">";

print "<IMG SRC=\"$images_path/category/none.gif\" ALT=\"$category_name\" TITLE=\"$category_name\" WIDTH=\"$store_cat_image_width\" BORDER=\"0\">";

Offline

 

#8 02-02-2005 12:51:26

pookie
Member
Registered: 11-03-2004
Posts: 57

Re: Add Alt Attribute To Images!

PERFECT!!! Thank You City Web :-)

Offline

 

#9 02-02-2005 15:04:08

Graham
Member
Registered: 09-30-2004
Posts: 1010
Website

Re: Add Alt Attribute To Images!

Just wanted to add my thanks too!

I've been meaning to get around to this for while and this thread prompted me to get it sorted :-)

Offline

 

#10 02-07-2005 12:31:56

CityWebSystems.com
Member
From: Utah
Registered: 03-12-2004
Posts: 95
Website

Re: Add Alt Attribute To Images!

No problem... I'm glad to help!  smile

Thanks to morvak for making the original post.

Offline

 

#11 03-19-2006 06:16:05

larryg
Member
Registered: 01-31-2006
Posts: 11

Re: Add Alt Attribute To Images!

Hi,

Good mod! But for some reason it does not show on the product detail page in latest version of ccp51. It will show on the small product pictures but not on the detail picture nor on the xlarge pictures. Where am I going wrong here? The category pictures works fine.

Have I missed a line that needs adjusting? The code used is below, same as what was posted.

The mod was made to the script in cgibin/ccp51/library/modules/ste_prod.pl

Thanks as always for the help! Great product, great forum!

Larry


Code:

#######################
# Ste Prod Show Image #
#######################
print "<IMG SRC=\"$images_path/product_category/$image_name\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_small_image_width\" BORDER=\"0\">";

print "<IMG SRC=\"$images_path/product_category/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_small_image_width\" BORDER=\"0\">";

##############################
# Ste Prod Show Image Detail #
##############################

print "<IMG SRC=\"$images_path/product_detail/$imglg\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";

print "<IMG SRC=\"$images_path/product_detail/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";

Offline

 

#12 03-19-2006 08:59:35

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Add Alt Attribute To Images!

Code looks right.  Sounds silly, but maybe you need to clear your browser's cache to see the changes?

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#13 03-19-2006 09:05:40

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Add Alt Attribute To Images!

What is the purpose of the Title tag in your image call?

Also, the large popup image call is in its own txt element.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#14 03-19-2006 09:14:23

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Add Alt Attribute To Images!

Blade - the Title attribute is for firefox browsers.

larry - I believe blade is right; the alt tag for the popup image would need to be added in ste_prdlg_popup.txt.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#15 03-19-2006 10:20:01

larryg
Member
Registered: 01-31-2006
Posts: 11

Re: Add Alt Attribute To Images!

Hi,

Rachel, Blade - thank you for your input.

No change RE: browser cache.

Yes, the title tag is there for Firefox; thank you Rachel.

Re: the popup x-large image: going to can that idea since they are not robot accessible anyway as I recall.

Gone through the whole process several times now and the last time I started all over with a clean copy of the ste_prod.pl.

Uploading correct and permissions are unchanged; same as when cart was installed.

Still no change; the small product item pictures are showing the alt, but the detail view is not.

This is how the code looks for both sections in the ste_prod.pl:

Code:

#####################################################
# Ste Prod Show Image                                                 #
#####################################################

print "<IMG SRC=\"$images_path/product_category/$image_name\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_small_image_width\" BORDER=\"0\">";

} else {

print "<IMG SRC=\"$images_path/product_category/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_small_image_width\" BORDER=\"0\">";

and in

Code:

#####################################################
# Ste Prod Show Image Detail                                          #
#####################################################

print "<IMG SRC=\"$images_path/product_detail/$imglg\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";

} ######### End of if statement.

} else {

print "<IMG SRC=\"$images_path/product_detail/none.gif\" ALT=\"$product_name\" TITLE=\"$product_name\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";

No mention was made of changing anything else.

So scratching head here.

Further ideas are welcome smile

Larry

Offline

 

#16 03-19-2006 12:27:40

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Add Alt Attribute To Images!

I believe the problem is that because you are using the images with popups, the image tag is created in the element ste_prdlg_popup.txt instead of in ste_prod.pl.  Try editing ste_prdlg_popup.txt and changing:

Code:

<IMG SRC="(CGIVAR)image_url(/CGIVAR)" WIDTH="(CGIVAR)store_large_image_width(/CGIVAR)" BORDER="0">

to:

Code:

<IMG SRC="(CGIVAR)image_url(/CGIVAR)" WIDTH="(CGIVAR)store_large_image_width(/CGIVAR)" BORDER="0" ALT="(CGIVAR)product_name(/CGIVAR)" TITLE="(CGIVAR)product_name(/CGIVAR)">

I'm reasonably certain that the product_name variable is loaded at that point, so the CGIVAR call should work.  It's worth a try, anyway.  By the way, this won't actually get an ALT attribute on the popped up image, just on the product detail image that links to the popup image.

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#17 03-19-2006 13:35:15

larryg
Member
Registered: 01-31-2006
Posts: 11

Re: Add Alt Attribute To Images!

Rachael,

You are right on the money!

Exactly what I wanted.

Thank you so much for being here to help and for posting all your great scripting solutions I am running into:) Hats off to you all on that!

Larry

Offline

 

#18 04-22-2006 13:05:07

Social Smoke
Member
Registered: 09-21-2003
Posts: 39

Re: Add Alt Attribute To Images!

I also use the Xlarge pop up images.

The Title and Alt tags work for product detail pictures and category pictures but do not work for product_category pictures. I have checked my code a few time so I do not think that is the problem.

Is the reason the product_category pictures do not show up because I use the Xlarge popup images?

Thanks,
Ali

Offline

 

#19 04-23-2006 13:58:43

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Add Alt Attribute To Images!

You need to edit the category product display element in admin. You prob are using the default, so just look for that one.

BTW, is that SEP spamming your using way down at the bottom of your pages in the itsy bitsy text? Black hat seo tactics will get you far more of a penalty than you will get via the benefits. Just a suggestion.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#20 04-23-2006 20:09:26

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Add Alt Attribute To Images!

I'm not sure what SEO mod you're using; but if it's the ATS one, the SEO mod should use the Category Name as the alt tag for the product_category images.

Rachael 


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#21 04-23-2006 22:03:28

Social Smoke
Member
Registered: 09-21-2003
Posts: 39

Re: Add Alt Attribute To Images!

Thanks to both of you...

Rachael, I'll ask ATS about the product category images...

theblade24: I'll check the category product element in the morning. The links on the bottom of the page might be in small font, but are not hidden or matching the background color. Is that really considered Black hat SEO? I'm no expert by any means, I'd like to hear what others think as well.

Offline

 

#22 04-24-2006 07:49:25

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Add Alt Attribute To Images!

All I'm saying is be careful!!!!!!!! All your hard work could down the drain!


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#23 06-12-2006 11:42:46

mhaysom
Member
Registered: 04-11-2005
Posts: 168

Re: Add Alt Attribute To Images!

hi, great mod thanks!

Just one question/request.....

Not sure if this is possible but is there a way of placing the 'main' category name in the alt tag, so theres the main category name followed by the sub category name......?

for example,

main category :
sub category : 

giving you a alt tag :

Hope this makes some sense!

Thanks again!

Offline

 

#24 09-04-2007 10:34:10

johnmartininsource
Member
From: Houston, TX
Registered: 02-20-2006
Posts: 8
Website

Re: Add Alt Attribute To Images!

Thanks for an easy mod/hack guys.


Save a Horse, ride a PsychoCowboy!

Offline

 

Board footer