forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: kylemj on April 30, 2015, 12:35:51 am

Title: Adding text before alt= description
Post by: kylemj on April 30, 2015, 12:35:51 am
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
Code: [Select]
    $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']}\"
Title: Re: Adding text before alt= description
Post by: allvip on April 30, 2015, 12:53:06 am
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)?
Title: Re: Adding text before alt= description
Post by: allvip on April 30, 2015, 02:15:41 am
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:

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


to:

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

Test it and it works (see attachments all additional text plus image title).
Title: Re: Adding text before alt= description
Post by: kylemj on April 30, 2015, 06:05:11 pm
Yeah thats how i want it,
Ive edited but the additional text but it stops the rest of the description
Code: [Select]
<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
Title: Re: Adding text before alt= description
Post by: allvip on April 30, 2015, 07:29:41 pm
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) :

Code: [Select]
                $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;
Title: Re: Adding text before alt= description
Post by: allvip on April 30, 2015, 07:37:23 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) ?
Title: Re: Adding text before alt= description
Post by: allvip on April 30, 2015, 11:10:32 pm
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 (http://www.w3schools.com/tags/att_img_alt.asp)
Title: Re: Adding text before alt= description
Post by: kylemj on May 03, 2015, 11:23:57 pm
Hi, sorry its working now, i think it was because i tested it with an image without a title  :-[
thank you for your help!