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.
[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
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
Offline
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.
Offline
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:
####################### # 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:
###################### # 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.
You'd think M$ had never heard of the W3C!
Offline
Thanks CityWeb.
The first part works fine for the products, but the second part:
###################### # 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
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:
###################### # 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
PERFECT!!! Thank You City Web :-)
Offline
No problem... I'm glad to help!
Thanks to morvak for making the original post.
Offline
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
####################### # 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
Code looks right. Sounds silly, but maybe you need to clear your browser's cache to see the changes?
Rachael
Offline
What is the purpose of the Title tag in your image call?
Also, the large popup image call is in its own txt element.
Offline
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.
Offline
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:
#####################################################
# 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
#####################################################
# 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
Larry
Offline
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:
<IMG SRC="(CGIVAR)image_url(/CGIVAR)" WIDTH="(CGIVAR)store_large_image_width(/CGIVAR)" BORDER="0">
to:
<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
Offline
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
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
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.
Offline
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
Offline
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
All I'm saying is be careful!!!!!!!! All your hard work could down the drain!
Offline
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
Thanks for an easy mod/hack guys.
Offline