[TYPO3-english] TypoScript/Fluid: get image title and description

Hagen Gebauer gebauer at mpi-cbg.de
Mon Mar 14 09:59:04 CET 2016


Hi everybody,

I have created my own content elements in order to use FAL images from tt_content.image as a background image. It works pretty well. But I want to add a small box with the image's title and description. I've been trying for days to find a solution. My TypoScript for the content element is

tt_content.text_bgpic = FLUIDTEMPLATE
tt_content.text_bgpic {
	file = EXT:my_extension/Resources/Private/Templates/Content/TextBgPic.html
	variables {
		imagePath = FILES
		imagePath {
			references {
				table = tt_content
				fieldName = image
			}
			renderObj = IMG_RESOURCE
			renderObj {
				file.import.data = file:current:publicUrl
				file.treatIdAsReference = 1
			}
		}
	}
}

In the Fluid template I can easily access the image path by {imagePath} set in the above TypoScript while every other data from the tt_content record is accessed by {data.[fieldname]} (e.g. {data.bodytext})

I tried several ways in the Fluid Template (like data.image.originalResource.title, with and without "data" and/or "originalResource"). And I found absolutely no way to set respective variables in the TypoScript (like imageTitle or imagePath.title or whatever)

Does anyone have an idea? Thanks a lot in advance!

Cheers,
Hagen.


More information about the TYPO3-english mailing list