Adding text before alt= description Adding text before alt= description
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Adding text before alt= description

Started by kylemj, April 30, 2015, 12:35:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kylemj

I've changed to theme to display titles instead of click to view full image but i wish to add a bit of text before it displays the description.

This is my code
    $pic_title = $lang_display_image_php['view_fs'] . $LINEBREAK . '==============' . $LINEBREAK . $pic_title;
                $pic_html .= "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"{$CURRENT_PIC_DATA['title']}\" /><br />";
                $pic_html .= $pic_html_href_close;
                //PLUGIN FILTER


and what i desire
alt=\"Additional Text Here {$CURRENT_PIC_DATA['title']}\"

allvip

I don't understand. Please be more detailed or post an image with how you want it to look.
The changes are for the image page or the pop up image (full size)?

allvip

#2
I got it.
You had alt: click to view full image (see attachments alt click to view full image) and changed to alt: image title (see attachments alt image title) and now you want alt: aditional text before image title (see attachments all additional text plus image title).

Then change:


alt=\"{$CURRENT_PIC_DATA['title']}\"


to:


alt=\"Additional Text Here {$CURRENT_PIC_DATA['title']}\"


Test it and it works (see attachments all additional text plus image title).

kylemj

Yeah thats how i want it,
Ive edited but the additional text but it stops the rest of the description
<img src="albums/userpics/10001/normal_57.JPG" width="700" height="608" class="image" border="0" alt="Additional Text Here " style="margin-bottom: 0px; padding-bottom: 0px;">


site: http://thepricey.com/gallery/displayimage.php?album=277&pid=2710#top_display_media
I'm using it for Pinterest description so the hover will bring up a pin it button

allvip

#4
If you followed with attention my instruction it works like it worked for me.
Please post the entire theme_html_picture function from your theme.php.

BTW: there is a difrence between alt (is for serch engine and other and not visible) and title. The title shows when you hover an image. See attachment.

Add title (additional title text + current image title) and alt  (adittional test + plus change "click to view full image" to current image title) :


                $pic_title = $lang_display_image_php['view_fs'] . $LINEBREAK . '==============' . $LINEBREAK . $pic_title;
                $pic_html .= "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"Additional Text Here {$CURRENT_PIC_DATA['title']}\" title=\"Additional Text Here {$CURRENT_PIC_DATA['title']}\" /><br />";
                $pic_html .= $pic_html_href_close;

allvip

Quote from: kylemj on April 30, 2015, 06:05:11 PM
site: http://thepricey.com/gallery/displayimage.php?album=277&pid=2710#top_display_media
I'm using it for Pinterest description so the hover will bring up a pin it button

You already have on hover a pin it button. You want a Pinterest button even for the pop up image (full size image) ?

allvip

HTML <img> alt Attribute

Definition and Usage

The required alt attribute specifies an alternate text for an image, if the image cannot be displayed.

The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

More: http://www.w3schools.com/tags/att_img_alt.asp

kylemj

Hi, sorry its working now, i think it was because i tested it with an image without a title  :-[
thank you for your help!