[TYPO3-mvc] How to get to cObj->IMAGE

Xavier Perseguers typo3 at perseguers.ch
Mon Jan 10 13:36:39 CET 2011


Hi,

> On 10.01.2011 08:46 Dawid Pacholczyk wrote:
>> There are many thing from the cObj object that can be usefull. Is there
>> any way to get to them directly ?
>>
>
> A generic way to render cObjects is the cObject viewhelper:
>
> <f:cObject typoscriptObjectPath="lib.myImage" />
>
> lib.myImage = IMAGE
> lib.myImage.file = fileadmin/user_upload/images/example.jpg
> lib.myImage.altText = Example image

And, good to know, you may pass an object to optional attribute data and 
then use it from TS as usual:

<f:cObject typoscriptObjectPath="lib.myImage" data="{yourObject}" />

lib.myImage = IMAGE
lib.myImage.file.import = fileadmin/user_upload/images/
lib.myImage.file.import.field = image
lib.myImage.file.import.listNum = 0
lib.myImage.altText.field = title

which would get attributes "image" and "title" from your object.

Xavier


More information about the TYPO3-project-typo3v4mvc mailing list