Y
Y
yvetrov2020-02-26 16:39:04
1C-Bitrix
yvetrov, 2020-02-26 16:39:04

How to automatically add alt to all pictures?

There is a site on Bitrix, it has more than 2500 pictures. It is necessary to set alt to pictures on each page, do it manually - it takes as long and difficult as possible, are there options to automate the process?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Aliy Kunashev, 2020-02-26
@yvetrov

If the pictures are static, then you can run all the files with autocorrect in any way.
If pictures are in infoblocks, then there are templates for alt and title images in the infoblock settings.
5e567c6a601d2329786072.png

A
Andrew Dry, 2020-02-26
@andrewdry7z

Add the same alt to all images?
If so, you can do this, for example, through search and replace in the site database.
We are looking for , replace with You can also do this in php, somewhere in the result_modifier <img<img alt='...'

A
Anton, 2020-02-26
@anton99zel

2500 pictures

So, for sure you have a template for the output, insert the alt generation by name into the template
<img src="URL" alt="<?=$arResult[NAME] ?>">

R
Ronni1500, 2020-02-28
@Ronni1500

Alternatively, if the pictures are crammed into the admin panel, then change the content either with js or with a script
through the OnEndBufferContent event.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question