[TYPO3-english] Re: Re: TypoScript/Fluid: get image title and description
Hagen Gebauer
gebauer at mpi-cbg.de
Wed Mar 16 18:02:43 CET 2016
Hi Bernd,
thank you very much again! So: I found out that in the example you can call the whole template Image.html from within TextBgPic.html by just calling <f:format.raw>{imagePath}</f:format.raw>. So far so good. But still I don't seem to be able to access any image data.
I unsuccessfully tried calling {publicUrl}, {image.publicUrl}, {imagePath.publicUrl}, {data.publicUrl} and some combinations in Image.html. Also <f:debug>{_all}</f:debug>, called in Image.html returns the full array "data" of the content element but no image data.
Sorry, if I'm being stupid here.
Cheers,
Hagen.
Quote: Bernd Wilke[1][2] wrote on Wed, 16 March 2016 08:34
----------------------------------------------------
> Am 15.03.2016 um 11:40 schrieb Hagen Gebauer:
> > Hi Bernd,
> >
> > thanks a lot for your reply. Regrettably I don't understand how to use
> > this information. I unsuccessfully tried several ways in TypoScript.
> > What I want to achieve is to use all image data (publicUrl, title,
> > description) in the template file that is already being called
> > (TextBgPic.html). And it should at best be just one database request for
> > all the image information.
> >
> > The CE is basically a copy of the standard CE "Text & Images" (textpic).
> > In another extension I wrote, I could easily access all information on
> > an image in the template by the property name of the image(s) (the
> > database field that stores how many images are linked to the record,
> > just as the "image" field in tt_content) in the way
> > image.originalResource.[publicUrl/title/...]
> >
>
> lets have a picture of the data:
> +---------------------------------+
> | data (tt_content) |
> | +----+ +----+ +----+ |
> | |img1| |img2| |img3| |
> | +----+ +----+ +----+ |
> +---------------------------------+
>
> in the same way you should template the data
>
> 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 = FLUIDTEMPLATE
> renderObj {
> file =
> EXT:my_extension/Resources/Private/Templates/Image.html
> }
> }
> }
> }
>
> and in EXT:my_extension/Resources/Private/Templates/Image.html you have
> access to all data of one image: (uid (sys_file), publicUrl, width,
> height, description, title, ...
> explore by using: <f:debug title="one image">{_all}</f:debug>
>
> bernd
----------------------------------------------------
More information about the TYPO3-english
mailing list