Modify ↓
Opened 9 years ago
Last modified 8 years ago
#1052 new Erweiterung
Fehlender Title-Tag bei Bildern
| Reported by: | matzell | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Shop | Version: | 2.0.0.0 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
Datei: /inc/xtc_image.inc.php
Zeile: 30
Bisher:
$image = '<img src="' . xtc_parse_input_field_data(DIR_WS_BASE.$src, array('"' => '"')) . '" alt="' . xtc_parse_input_field_data($alt, array('"' => '"')) . '"';
Ändern zu:
$image = '<img src="' . xtc_parse_input_field_data(DIR_WS_BASE.$src, array('"' => '"')) . '" title="' . xtc_parse_input_field_data($alt, array('"' => '"')) . '" alt="' . xtc_parse_input_field_data($alt, array('"' => '"')) . '"';
Grund:
Durch das fehlen des Title-Tags kann z.B. dem Slider kein Caption hinzugefügt werden. Zudem ist es ratsam, dass ein jedes Bild IMMER mit einem Title versehen ist.
Attachments (0)
Change History (7)
comment:1 by , 9 years ago
| Milestone: | → modified-shop-2.0.1.1 |
|---|---|
| Type: | Bug/Fehler → Erweiterung |
| Version: | → 2.0.0.0 |
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Aus dem Text:
[...] Das Title-Attribute sollte dafür genutzt werden, dem mit einer Mouse über ein Bild fahrenden Besucher anzuzeigen, was ggf. passiert, wenn er/sie auf das Bild klickt. Das Title-Attribute kann z.B. title=“Bild vergrößern“ oder „Öffnet in einem neuen Fenster“ lauten. [...]
Das title & alt nicht den gleichen Inhalt haben sollen, muss man die komplette Funktion ändern und um $title erweitern:
function xtc_image($src, $alt = '', $width = '', $height = '', $parameters = '', $title = '') {
if ( (empty($src) || ($src == DIR_WS_IMAGES) || ( $src == DIR_WS_THUMBNAIL_IMAGES))) {
return false;
}
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="' . xtc_parse_input_field_data(DIR_WS_BASE.$src, array('"' => '"')) . '"' . (!empty($title) ? (' title="' . xtc_parse_input_field_data($title, array('"' => '"')) . '"') : '') . ' alt="' . xtc_parse_input_field_data($alt, array('"' => '"')) . '"';
if (defined('CONFIG_CALCULATE_IMAGE_SIZE') && CONFIG_CALCULATE_IMAGE_SIZE == 'true' && (empty($width) || empty($height)) && is_file($src)) {
if ($image_size = @getimagesize($src)) {
if (empty($width) && xtc_not_null($height)) {
$ratio = $height / $image_size[1];
$width = (int)($image_size[0] * $ratio);
} elseif (xtc_not_null($width) && empty($height)) {
$ratio = $width / $image_size[0];
$height = (int)($image_size[1] * $ratio);
} elseif (empty($width) && empty($height)) {
$width = $image_size[0];
$height = $image_size[1];
}
} elseif (defined('IMAGE_REQUIRED') && IMAGE_REQUIRED == 'false') { //DokuMan - 2010-02-26 - set undefined constant
return false;
}
}
if (xtc_not_null($width) && xtc_not_null($height)) {
$image .= ' width="' . xtc_parse_input_field_data($width, array('"' => '"')) . '" height="' . xtc_parse_input_field_data($height, array('"' => '"')) . '"';
}
if (xtc_not_null($parameters)) $image .= ' ' . $parameters;
$image .= ' />';
return $image;
}
comment:4 by , 9 years ago
| Milestone: | modified-shop-2.0.2.0 → modified-shop-2.0.2.1 |
|---|
comment:5 by , 9 years ago
| Milestone: | modified-shop-2.0.2.1 → modified-shop-2.1.0.0 |
|---|
comment:6 by , 9 years ago
| Milestone: | modified-shop-2.1.0.0 → modified-shop-2.0.3.0 |
|---|
comment:7 by , 8 years ago
| Milestone: | modified-shop-2.0.4.1 |
|---|
Note:
See TracTickets
for help on using tickets.

Hier steht einiges zum Thema alt und title Tags
https://www.seo-united.de/blog/seo/alt-und-title-attribute-bilder.htm