Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Adding text before alt= description  (Read 6647 times)

0 Members and 1 Guest are viewing this topic.

kylemj

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Adding text before alt= description
« 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']}\"
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Adding text before alt= description
« Reply #1 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)?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Adding text before alt= description
« Reply #2 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).
« Last Edit: April 30, 2015, 07:25:54 pm by allvip »
Logged

kylemj

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Adding text before alt= description
« Reply #3 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
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Adding text before alt= description
« Reply #4 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;
« Last Edit: April 30, 2015, 11:03:13 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Adding text before alt= description
« Reply #5 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) ?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Adding text before alt= description
« Reply #6 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
Logged

kylemj

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Adding text before alt= description
« Reply #7 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!
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.