[TYPO3-content-rendering] Image longdesc attribute in HTML5

Patrick Broens patrick at patrickbroens.nl
Mon Aug 8 15:16:15 CEST 2011


On 8-8-11 14:41 , Patrick Broens wrote:
> Thomas Deinhamer has added a comment to the issue on Forge [1]. Because
> I like to discuss this here, I'm moving over his comments to this
> mailing list:
> 
> There's also another solution which I'm using in hype_html5:
> 
> <snip>
> 
> <figure>
>   <a href="#enlarged-version">
>     <img />
>   </a>
>   <figcaption>
>     <a href="#longdesc-url">
>       {$caption}
>     </a>
>   </figcaption>
> </figure>
> 
> </snip>
> 
> Advantage: There can be an image link or a lightbox/enlarged version
> additionally to a linked caption.
> 
> Another solution would be to
> a.) link the longdesc-url on the image itself only if there's no link
> yet, otherwise
> b.) link the caption, if available.
> 
> But I think that's to confusing.
> 
> Then he commented another time:
> One argument for the mentioned solution would be that linking the
> caption to a "longer" description makes good sense in terms of semantic,
> I guess.
> 
> [1] http://forge.typo3.org/issues/28752

IMHO we should not throw away the longdesc URI so I went on reading and
I think the solution of Thomas is quite good. I'm using a different
markup for images and captions because we need to be compliant with IE7,
even if it is HTML5. But that does not change anything to this situation ;-)

I've done a test with the "aria-describedby" attribute. This one can
only take an id, but is allowed to refer to one of the anchors like this:

<snip>

<a id="longdesc" href="/index.php?id=1">
<img aria-describedby="longdesc" src="source.jpg">
</a>

</snip>

This can also be done in the case of a caption and a link in it.

The only way we can't provide a longdesc alternative is when there is
already a link on an image and no caption. So, what to do with this?

aria-decribedby is only supported in HTML5 ;-)

Cheers

Patrick


More information about the TYPO3-project-content-rendering mailing list