contao/core — Issue #4023: The Mediabox script does not take into account the "title" and "alt" attributes
Author: xchs
Created: 2012-02-29 13:04:26+00:00
State: open

The Mediabox script does not take into account the `title` and `alt` attributes of lightbox images since this information are available only in the `` tag (cf. also the developer website and some of the examples shown there).

To reproduce this issue in the Contao online demo follow these steps:

1. Create a new article content element of type *"Image"* or *"Text"*
2. Add/select an image
3. Enter both an *"Alternate text"* and/or a *"Title"* text
4. Enable the option *"Full-size view/new window"*
5. Open the frontend view and click on the previously added (lightbox) image
6. Neither the *"Title"* nor the *"Alternate text"* is displayed as lightbox caption

With the following template modification (*id est* regarding the anchor element `` and the respective element attributes) this issue could be solved:

https://github.com/contao/core/blob/3.0.x/system/modules/frontend/templates/ce_image.html5#L10
https://github.com/contao/core/blob/3.0.x/system/modules/frontend/templates/ce_text.html5#L15

```php
attributes; ?>title): ?> title="title; ?>" title="alt; ?>">

imgSize; ?> alt="alt; ?>">
href): ?>

```

The same of course for the corresponding XHTML templates.

[Contao 2.11.1]

Related to: #3967