2016-04-28 30 views
-2

Ich möchte Alt-Text für alle Bilder hinzufügen, die von TYPO3-Backend mit TypoScript enthalten sind.Auto-fill "alt" -Text mit Imagefile Name mit TypoScript?

<img title="ABC" alt="....." src="fileadmin/uploads/abc/nature.jpg"> 

Bitte teilen Sie, wenn jemand diesbezüglich eine Antwort haben.

+0

Geben Sie Ihren Code in Ihre Frage ein. –

+0

Ich brauche dafür TypoScript-Code. –

Antwort

0

Sie können automatisch Alt-Text für alle Bilder hinzufügen, die von fal oder by rte hochgeladen wurden. Verwenden Sie dazu den TypoScript-Code in der Vorlage-Setup-Datei.

temp.altText > 
temp.altText < tt_content.image.20.1.altText 
tt_content.image.20.1.altText > 
tt_content.image.20.1.altText.cObject = COA 
tt_content.image.20.1.altText.cObject { 
    10 < temp.altText 
    20 = TEXT 
    20 { 
     noTrimWrap = | | | 
     data = file:current:name 
    } 
} 

if you want to add page title in alt text of images then use below code 

temp.altText > 
temp.altText < tt_content.image.20.1.altText 
tt_content.image.20.1.altText > 
tt_content.image.20.1.altText.cObject = COA 
tt_content.image.20.1.altText.cObject { 
    10 < temp.altText 
    20 = TEXT 
    20 { 
     noTrimWrap = | | | 
     data = page:title 
    } 
}