Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2024-04-12 07:32:06
- joanlafulla_Almas
- Member
- Registered: 2011-02-25
- Posts: 21
Automatic Alt text for my images
I need to establish a rule to automatically introduce alt text in the main image of my article. Something like this:
<txp:image alt=“This is a still of the movie <txp:title />, directed by <txp:custom_field name=‘director’ /> in <txp:custom_field name=‘año’ />” />
I think this is NOT possible with <txp: image /> default tag.
Do you know of any plugin or solution to cover this need?
Offline
Re: Automatic Alt text for my images
No, but you can wire it up by hand. Something like this (untested) :
<if::article_image>
<txp:images limit="1">
<img src="<image::url />" alt="This is a still of the movie <txp:title />, directed by <custom::field name='director' /> in <custom::field name='año' />" />
</txp:images>
</if::article_image>
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#3 2024-04-12 08:39:19
- joanlafulla_Almas
- Member
- Registered: 2011-02-25
- Posts: 21
Re: Automatic Alt text for my images
Thank you very much. It works perfectly :-)
Offline
Re: Automatic Alt text for my images
For the record, in txp 4.9-dev <txp:image />
seems to take alt
attribute.
Offline
Pages: 1