[TYPO3-english] Creating an XML for pageflipper per tt_news record

Peter Klein pmk at io.dk
Sat May 1 00:36:47 CEST 2010


Hi Bert.

TSFE:lastImageInfo| is only available AFTER you have processed an IMAGE 
object.
If you change your TS, so that instead of using dataWrap, you create an 
IMAGE object, then it should work.

If you just need to return the url and do the wrapping yourself, you can 
create an IMG_RESOURCE object.
Then the width/height info is stored in TSFE:lastImgResourceInfo|

--
Peter Klein / Clio Online

"Bert Hiddink [BENDOO e-work solutions]" <hiddink at bendoo.com> wrote in 
message news:mailman.1.1272633231.15348.typo3-english at lists.typo3.org...
> Hello!
>
> Please see the code below. I managed to create an XML file of the images 
> per tt_news-record and then feed this XML into a page-flipper.
> Works fine!
>
> However, when I create the mark-up for an image, I need to add some 
> additional info, besides the NAME of the image.
>
> In particular, I need to pass the width and height of each image.
> The needed output is:
>               <page>
>                <img src="uploads/pics/123.jpg" width="width_if_this_image" 
> height="height_if_this_image" />
>               </page>
>
>
> I know this is stored in:
> 20 = TEXT
> 20.data = TSFE:lastImageInfo|0
>
> and
>
> 20 = TEXT
> 20.data = TSFE:lastImageInfo|1
>
> However, I do not see how I can do this. I tried:
>
> xmlmegazine.30 = RECORDS
> xmlmegazine.30 {
>     dontCheckPid = 1
>     tables = tt_news
>     source.data = GPvar:tx_ttnews|tt_news
>     conf.tt_news = TEXT
>     conf.tt_news {
>       field = image
>        split {
>            token=,
>            cObjNum = 1
>            1.current = 1
>            1.dataWrap (
>               <page>
>          <img src="uploads/pics/|" width="{TSFE:lastImageInfo|0}" 
> height="{TSFE:lastImageInfo|1}"/>
>               </page>
>
>             )
>       }
>     }
>     conf.tt_news.required = 1
> }
>
>
> ...but this returns an empty value:
>  <book>
>     <chapter>
> <page>
>          <img src="uploads/pics/Oranje_tray.jpg" width="" height=""/>
>               </page><page>
>          <img src="uploads/pics/lekkersnelfolder1_03.jpg" width="" 
> height=""/>
>               </page><page>
>          <img src="uploads/pics/lekkersnelfolder2_02.jpg" width="" 
> height=""/>
>
>               </page><page>
>          <img src="uploads/pics/lekkersnelfolder3_02.jpg" width="" 
> height=""/>
>               </page>
>     </chapter>
> </book>
>
> Any ideas here?
>
> Thanks in advance!!!!
>
> Bert
>
>
>
>
>
>
>
>
>
>
> 




More information about the TYPO3-english mailing list