Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-03-18 18:59:33

J-zef
New Member
From: Russia, Saratov
Registered: 2019-03-16
Posts: 5
Website

No titles for images in 4.7.3?

After upgrading to v4.7.3 I noticed, that attributes title has disappeared from tags <img />.
Does it a bug, or a new feature? o_O

Last edited by J-zef (2019-03-18 19:00:12)


Credendo vidas!

Offline

#2 2019-03-19 09:11:54

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: No titles for images in 4.7.3?

Hello, welcome to the forum.

Did txp image tags ever had title attribute? What was your previous txp version?

Offline

#3 2019-03-19 09:23:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: No titles for images in 4.7.3?

I think maybe the OP means the HTML title attributes on the resulting <img> tags because those were indeed axed. They used to be fed automatically from the caption but we ditched it for reasons I now cannot remember. There was a fairly long discussion about it somewhere.

A couple of avenues to explore:


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

#4 2019-03-19 09:54:30

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: No titles for images in 4.7.3?

Ah yes, I see. Then we could probably introduce it? No title by default, a valueless title mean caption and title="My Title" works as supposed?

Offline

#5 2019-03-19 09:58:14

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: No titles for images in 4.7.3?

etc wrote #317154:

we could probably introduce it? No title by default, a valueless title mean caption and title="My Title" works as supposed?

Sounds good.

For reference, here’s the commit back in 2014 that removed it. As I say, I forget why we removed it by default. Probably for accessibility or SEO reasons or something.


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

#6 2019-03-19 15:01:36

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: No titles for images in 4.7.3?

The problem, if I recall the conversation, was that title="" and <figcaption> are two entirely different things, and it was always very annoying that an image’s title="" attribute was being filled by the caption field.

Create a title form field if you can, but please don’t cross the channels as before. ;)

Offline

#7 2019-03-19 15:08:06

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: No titles for images in 4.7.3?

IIRC, title is not an attribute of the img tag, only alt.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2019-03-19 17:30:17

J-zef
New Member
From: Russia, Saratov
Registered: 2019-03-16
Posts: 5
Website

Re: No titles for images in 4.7.3?

etc, I upgraded my site form 4.5.3 or smth like this (yes, I procrastinated for a long time :)). I have a little script based on LightZoom, this script takes the image annotation from the title attribute of the img tag. And after upgrade it became broken, because img tags have no attribute title at all.
I fixed it in some way, using attribute alt instead, but I like this attribute, and any other tag except img has this attribute…
(and I don’t want to edit over 2000 images on my site, because I don’t remember exactly, what was written in their alt text fields :))

jakob wrote #317163:

IIRC, title is not an attribute of the img tag, only alt.

As I know, title is an attribute of any html tag, including img tag?


Credendo vidas!

Offline

#9 2019-03-19 18:31:25

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: No titles for images in 4.7.3?

I understand, apologize and agree to some point. FWIW, title is available (but not imposed) in dev branch again. But things can change yet, so a manual tag construction seems to be the only choice atm.

Offline

#10 2019-03-19 18:58:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: No titles for images in 4.7.3?

I think (and I’m dredging memory banks here) part of the reason for removing the title attribute in the first place was precisely that it’s available in HTML, but its implementation at the browser level was not defined. Most browsers offer it as a tooltip, but it’s not guaranteed. And some screen readers are flaky with it. On mobile, well, it’s largely a waste of bytes as there’s no implicit hover state.

J-zef wrote #317165:

I fixed it in some way, using attribute alt instead, but I like this attribute, and any other tag except img has this attribute

We decided to axe it by default because, if you really needed it, you could just change your image tag to add it back by hand exactly how you wanted it. No need to revisit every image and make new alt texts or captions or anything. Can you not tweak your <img> or <txp:image> tags and add title='<txp:image_info />' to restore this functionality?

Last edited by Bloke (2019-03-19 18:59:51)


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

#11 2019-03-21 18:25:10

J-zef
New Member
From: Russia, Saratov
Registered: 2019-03-16
Posts: 5
Website

Re: No titles for images in 4.7.3?

Bloke yes, I’ll try this. Thank you =)


Credendo vidas!

Offline

Board footer

Powered by FluxBB