Exercise caution with this. I think the ALT tag has a limit to the amount of characters because there's a certain point where Google thinks you are keyword stuffing.
That said stuff these lines of code somewhere (the best place is /system/config/dcaconfig.php).
Code:
// This defaults to 255 so if you want to make longer...
$GLOBALS['TL_DCA']['tl_content']['fields']['alt']['eval']['maxlength'] = 511;
// If you want to make it multiline...
$GLOBALS['TL_DCA']['tl_content']['fields']['alt']['inputType'] = 'textarea';
// And without this the text area gets a bit long for your needs...
$GLOBALS['TL_DCA']['tl_content']['fields']['alt']['eval']['style'] = 'height: 60px;';
It's probably more "proper" to instead use the caption field. If you enter your text into that, you can copy the "ce_image.tpl" template from "/system/modules/frontend/templates/" into your theme's templates folder.
Then you can customize it by changing...
Code:
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
to...
Code:
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->caption; ?>">
And if you don't want a caption below the actual image, remove this...
Code:
<?php if ($this->caption): ?>
<div class="caption"><?php echo $this->caption; ?></div>
<?php endif; ?>
And that, in a nutshell, is an example of what rules about Contao...
Bookmarks