[Typo3-dev] tslib_content::getAltParam()

Martin T. Kutschker Martin.T.Kutschker at blackbox.net
Wed Mar 24 14:18:23 CET 2004


Robert Lemke wrote:
> Hi Martin et al,
> 
> On Mon, 2004-03-22 at 14:42, Martin T. Kutschker wrote:
> 
>>It's a good thing that Typo3 support also the title attribute (if only
>>for images).
>>
>>But I'm not happy with two issues. First, I'm unsure about the benefits 
>>of using strip_tags() on the content since it's protected by 
>>htmlspecialchars() anyway. It's not necessary and may lead to unexpected 
>>results.
> 
> Could you give an example of a situation when strip_tags would cause any
> problems? I didn't put it in there for security reasons but for the
> visual representation and fulfilling the standards. The alt="" and
> title"" parameters are meant to only contain text.

Yes of course. But let user decides what's an appropriate content. 
Perhaps a bit stupid example, but consider an image depicting an em-tag. 
The logical alt-text is "<em>" which will unnecessarily be removed.

I consider it unlikely that users will bring tags into the alt-text 
anyway. And if there is some chance it's on purpose. So why bother 
stripping?

>>Second, I'm not convinced that the use-alt-for-title-feature is doing 
>>any good. It may be convenient for a short period while sites make a 
>>transition into proper using of title-attributes, but not more. IMHO it 
>>would be more sensible to use the alt-text as title-text and have an 
>>empty alt-tag. This saves bandwith and old-style alt-texts should in 
>>99.9% really be title-texts.
> 
> After following this discussion and re-reading the suggestions of the
> W3C I decided to leave it as it is now.
> 
> If you want to provide an empty alt parameter and use the title
> parameter instead, you can easily do that by using the appropriate
> stdWrap property.

Duh, so no way to turn off unwanted title-attibutes? That's my main 
concern. I'm for alt-attribues in every image, but see absolutely no 
virtue in duplicating the-alt attribute in the title-attribute. *)

> If you'd like to specify a title parameter independently from the alt
> parameter in your text w/image content element, I suggest to get in
> touch with Volker Hielscher, the author of the alttext for images
> extension. If he didn't do already, he could easily provide a second
> text area for specifying the title parameter.

Ahem, I think this is a serious issue. It seems that some folks here 
care about accessability, some even mention laws. I really think that 
Typo3 should have some built-in support for both alt- and 
title-attribute in these core elements - and of course in the RTE. 
Doesn't mean it has to be in 3.6, but it'd be a shame if it isn't in 3.7.

Perhaps one of the devs with CVS acces could check out Volker's 
extension and see if it is reasonable code. If yes, how can it be 
extended to allow for a title-attribute.

Dunno, what's the procedure now, but perhaps Volker can provide a patch.

Masi

*) If you want a title, then set one.





More information about the TYPO3-dev mailing list