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

Hagen Gebauer gebauer at mpi-cbg.de
Thu Mar 17 14:05:27 CET 2016


Quote: Bernd Wilke[1][2] wrote on Thu, 17 March 2016 08:42
----------------------------------------------------
> compare the debug output from the outer template (TextBgPic.html) with 
> the debug output from the inner template (Image.html). there should be 
> some difference.
> 
> bernd
----------------------------------------------------

Hi again,

they both output the "data" array (all data from the record of the tt_content table) and a variable called "current" which is defined as NULL. The outer template (TextBgPic.html) additionally contains the variables added in the TypoScript setup. Including the basic html from Image.html (with data from the data array if I call it there) in the variable imagePath.

I found out that $GLOBALS['TSFE']->lastImgResourceInfo  which I use to get the width and height of the image  also contains the FAL objects of the original and the processed images. After setting imagePath I set imgWidth (and imgHeight respectively) like this:
imgWidth = TEXT
imgWidth.data = TSFE:lastImgResourceInfo|0

It is said that just like 0 for width, 1 for height, and so forth, "originalFile" contains "the FAL object referencing the original file". Of course, I can't find anywhere how to access it correctly from TypoScript. It's not a surprise that it isn't a TEXT object. I tried COA and some others but all of these seem to return an empty string:
imgData = COA
imgData.data = TSFE:lastImgResourceInfo|originalFile

Cheers,
Hagen.


More information about the TYPO3-english mailing list