coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: sbouilland on March 26, 2009, 04:07:53 PM

Title: [Solved]: alt tag for pictures
Post by: sbouilland on March 26, 2009, 04:07:53 PM
Hi !

In order to get a better referencement of my pictures with google, I would like to replace the text "clic to enlarge" in the "alt" tag of the picture. I would like to write the title ou description (comming from IPTC) in this tag.

For the moment, here is what I have in the generated source code :
<a href="javascript:;" onclick="MM_openBrWindow('displayimage.php?pid=99&amp;fullsize=1','108313504249cb97cf21c82','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=505,height=335')"><img src="albums/ImportPhotos/Brumes%20Picardes/Brumes_03.jpg" class="image" border="0" alt="Cliquez pour voir l'image en taille réelle" /><br /></a>

I would like to replace "Cliquez pour voir l'image en taille réelle" by the image title.

Is there a way to do this ?

Sorry for my bad english and many thanks by advance for your help !
Title: Re: alt tag for pictures
Post by: Nibbler on March 26, 2009, 04:26:46 PM
Copy theme_html_picture() from the sample theme.php to your custom theme.php, find


$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";


change to


$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$CURRENT_PIC_DATA['title']}\" /><br />";


Use the french support section if you prefer.
Title: Re: alt tag for pictures
Post by: sbouilland on March 27, 2009, 07:58:21 AM
Thank you very much, I will try this right now !