Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten Ansicht
  #1  
Alt 12.02.08, 11:06
Forum Aktivist
 
Registriert seit: 24.03.06
Alter: 27
Beiträge: 78
TypoScript Frage: ALT-Text zum Bild und Lightbox

Hallo,

ich verändere über TypoScript den ALT-Text von Bildern:

Typoscript-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
tt_content.image.20.1.altText >
tt_content.image.20.1.altText = TEXT
tt_content.image.20.1.altText {
cObject = TEXT
cObject {
field = altText
split {
      // an Zeilenumbruch abschneiden
token.char = 10
returnKey.data = register : IMAGE_NUM_CURRENT
}
}

  // wenn kein alt-Text gesetzt ist
ifEmpty.cObject = TEXT
ifEmpty.cObject {
field = image
    // aktuelles Bild holen, z.B. mein-bild_01.jpg
listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
split {
      // an _ abschneiden
token.char = 95
cObjNum = 1 |*| 1 |*| 2
      // 1. ist z.B. mein-bild
1.current = 1
      // Leerzeichen einfügen
1.noTrimWrap = || |
      // 2. ist z.B. 01.jpg
2.cObject = TEXT
2.cObject.current = 2
2.cObject.split {
token.char = 46
cObjNum = 1 |*| 2
1.current = 1
}
}
}
}

Wenn ein Wert im ALT-Feld gesetzt ist, wird dieser genommen, ansonsten wird der Bildname verwendet. Vor Verwendung wird der Bildname noch "schön" gemacht, aus "lorem-ipscream_08.jpg" wird "lorem-ipscream 08":

HTML-Code:
<a target="thePicture" onclick="openPic('http://xxx/typo3_basic/www/index.php?eID=tx_cms_showpic&file=uploads%2Fpics%2Florem-ipscream_08.jpg&width=800m&height=600m&bodyTag=%3Cbody%20style%3D%22margin%3A0%3B%20background%3A%23fff%3B%22%3E&wrap=%3Ca%20href%3D%22javascript%3Aclose%28%29%3B%22%3E%20%7C%20%3C%2Fa%3E&md5=0bb603fc7ede8314c6529db3dc9acd3f','thePicture','width=450,height=349,status=0,menubar=0'); return false;" href="index.php?eID=tx_cms_showpic&file=uploads%2Fpics%2Florem-ipscream_08.jpg&width=800m&height=600m&bodyTag=%3Cbody%20style%3D%22margin%3A0%3B%20background%3A%23fff%3B%22%3E&wrap=%3Ca%20href%3D%22javascript%3Aclose%28%29%3B%22%3E%20%7C%20%3C%2Fa%3E&md5=0bb603fc7ede8314c6529db3dc9acd3f"> <img width="129" height="100" border="0" alt="lorem-ipscream 08" src="typo3temp/pics/lorem-ipscream_08_c1f2c164bd.jpg"/> </a>
Nun hab ich mir die Extension wsclicklightbox installiert, die alle "Klick-vergrößern"-Bilder in einer Lightbox öffnet. Doch diese Extension funktioniert nicht, und zwar wegen meiner TS-Zeile "token.char = 95". Wenn ich diese rausnehme, sieht der HTML-Code wie gewünscht aus, nur das ALT-Attribut ist eben nicht gesetzt wie gewünscht:

HTML-Code:
<a rel="lightbox[c413]" target="_self" href="uploads/pics/lorem-ipscream_08.jpg"> <img width="129" height="100" border="0" alt="lorem-ipscream_08.jpg" src="typo3temp/pics/lorem-ipscream_08_c1f2c164bd.jpg"/> </a>
Woran könnte das liegen? Hier ist der TS-Code von wsclicklightbox:

Typoscript-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
tt_content.image.20.1.imageLinkWrap {
typolink >
typolink {

// Link the thumbnail with the big image
parameter.cObject = IMG_RESOURCE
parameter.cObject.file {
import.current = 1
width = {$styles.content.imgtext.linkWrap.width}
height = {$styles.content.imgtext.linkWrap.height}
effects = {$styles.content.imgtext.linkWrap.effects}
}

// Remember that we need the JS libs
parameter.postCObject = LOAD_REGISTER
parameter.postCObject {
INCLUDE_PROTOTYPE = 1
INCLUDE_SCRIPTACULOUS = effects
INCLUDE_LIGHTBOX = 1
}

// If there is a link set for the image (field: image_link) override the previously set link with this one!
parameter.override {
field = image_link
listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
}

// Setup the link for use with lightbox, again if there is no link in field: image_link
ATagParams = rel="lightbox[c{field:uid}]"
ATagParams.insertData = 1
ATagParams.if.isFalse < .parameter.override

// Targets, as usual
target = {$styles.content.links.target}
extTarget = {$styles.content.links.extTarget}
}
}

Gruß Sven
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
Antwort


Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge anzufügen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

vB Code ist An.
Smileys sind An.
[IMG] Code ist An.
HTML-Code ist Aus.
Trackbacks are An
Pingbacks are An
Refbacks are An


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Inhaltstyp "Text m/ Bild" zeigt keinen Text C-rank TYPO3 4.x Fragen und Probleme 1 14.03.08 12:14
Frage zu TypoScript abarbeitungsreihenfolge? typonewbe TYPO3 4.x Fragen und Probleme 1 05.12.07 14:13
Text m/Bild | Bild ÜBER der Überschrift? Winddancer TYPO3 4.x Fragen und Probleme 3 16.11.07 15:51
Text m/Bild Evil-Knievel TYPO3 4.x Fragen und Probleme 6 03.11.07 16:10
Frage zu Typoscript und Objektplatzierung auf Homepage timmy2007 TYPO3 4.x Fragen und Probleme 4 09.02.07 08:43


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:13 Uhr.


Powered by vBulletin® Version 3.6.8 Patch Level 2 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Template-Modifikationen durch TMS