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

Hagen Gebauer gebauer at mpi-cbg.de
Fri Mar 18 16:25:03 CET 2016


Hi,

I found a working way. Although as far as I understand it that means an extra database query which I had tried to avoid.
If anyone knows how to make use of TSFE:lastImgResourceInfo|originalFile I'd still be happy to know.

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
                #titleText.data = file:current:title
            }
        }
        imageDescription = FILES
        imageDescription {
            references {
                table = tt_content
                fieldName = image
            }
            renderObj = TEXT
            renderObj.data = file:current:description
        }
        imgWidth = TEXT
        imgWidth.data = TSFE:lastImgResourceInfo|0
        imgHeight = TEXT
        imgHeight.data = TSFE:lastImgResourceInfo|1
        #imgData = COA
        #imgData.data = TSFE:lastImgResourceInfo|originalFile
    }
}

Thanks a lot again for your help, Bernd.

Cheers,
Hagen.


More information about the TYPO3-english mailing list