[TYPO3-content-rendering] Question regarding image attributes

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri May 5 09:47:54 CEST 2006


Stanislas Rolland schrieb am 05.05.2006 06:22:

> I am about to complete an integration of htmlArea RTE with DAM. This
> feature allows to use the DAM element browser to select and insert an
> image into the record being edited. Doing so we can set the title and
> alt attributes of the img tag, in the language of the edited record, if
> available in the DAM table. The DAM record includes a field specifically
> for the alt attribute. There are also a title field and a caption field.
> My question: which DAM attribute should be used to fill the title
> attribute of the img tag, if at all?

That sounds cool, Stanislas! Will the alt/title text be saved with the
HTML-content? What if someone changes the alt/title text in DAM later?
Will you save a reference to DAM, so we always have the "latest" text here?

As of the "title" attribute, I would love to see this configurable: The
admin can decide from which field in DAM the title should come. And the
user must be able to overwrite the title "entity-wise", so that the same
image might have different titles depending on its usage (this probably
doesn't apply to alt-attribute).

There are three issues with the title-attribute regarding accessibility
and browser compatibility, maybe these are relevant in this part of RTE
code too:

1) accessibility: you should/must have a title attribute in the link
that surrounds an image. This would describe the destination of the
link. (done in Text w/ images with the
"styles.content.imgtext.titleInLink" constant).

2) tooltips: IE uses IMG.title > IMG.alt (in this preference order) as a
tooltip for an image on mouse-over. Other modern browsers use A.title >
IMG.title as a tooltip, which is consistent with 1). But since we have
to make IE happy, we usually duplicate the A.title as IMG.title (done in
Text w/ images with "styles.content.imgtext.titleInLinkAndImg").

3) And to avoid IE from showing the IMG.alt as a fallback for its
tooltip, we place an empty IMG.title if there is no title (constant
"styles.content.imgtext.emptyTitleHandling").


Cheers,
Ernesto



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