How to change the alt value of embed code?

Status
Not open for further replies.

koxle

Network license
License owner
Joined
May 5, 2016
Messages
48
Points
58
I would like to output the image title into the alt value instead of the ID.jpg
I have edited the route.image.php at route and the embed.php in snippets.
The anywhere uploader and the page of image can output the title to alt value correctly(replace %FILENAME% to %TITLE%),
but the album and the user image list cannot output the correct alt value.
How can i change it correctly?
 

koxle

Network license
License owner
Joined
May 5, 2016
Messages
48
Points
58
It seems no one know.
I have to give up.
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
16,587
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
This controls listings: app/themes/Peafowl/tpl_list_item/image_cover_image.php

PHP:
<img src="%IMAGE_DISPLAY_URL%" alt="%IMAGE_TITLE%" width="%IMAGE_DISPLAY_WIDTH%" height="%IMAGE_DISPLAY_HEIGHT%">
This controls embed codes: app/themes/Peafowl/snippets/embed.php

Replace this:
PHP:
alt="%FILENAME%"
With this:
PHP:
alt="%TITLE%"
To make it work with listings open app/lib/functions.render.php

Replace this:
PHP:
$object = G\array_filter_array($item, ['image', 'medium', 'thumb', 'name', 'extension', 'size_formatted', 'display_url', 'how_long_ago', 'url', 'url_viewer', 'filename']);
With this:
PHP:
$object = G\array_filter_array($item, ['image', 'medium', 'thumb', 'name', 'title', 'extension', 'size_formatted', 'display_url', 'how_long_ago', 'url', 'url_viewer', 'filename']);
In the future keep in mind that I can't be on top of each customization need.

Cheers,
Rodolfo.
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
16,587
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
  • Like
Reactions: wdump
Status
Not open for further replies.