[TYPO3-mvc] How to access first element of Tx_Extbase_Persistence_ObjectStorage in fluid?

Andreas Kiessling andreas.kiessling at web.de
Tue Mar 16 18:57:05 CET 2010


Hi Franz,

On 16.03.2010 11:12, Franz Koch wrote:
> Hi,
>
>> i am working on an extension, where dam records can be referenced.
>> So far, im getting an object of type
>> Tx_Extbase_Persistence_ObjectStorage back, over which i can iterate with
>> the for-viewhelper and display the records. But since i only assign one
>> record to this field (limited in TCA), iterating isn't really needed.
>
> I'm using a patched version of extbase with native support for TCA-group
> fields, and there I directly get the DAM object back instead of the
> objectStorage if I limit the field to 1 in TCA.
>
> I've created a patch for this some time ago, you can find it here:
> http://forge.typo3.org/issues/show/6249

Since your feature request got accepted, this will hopefully find its 
way to SVN soon.

For the meantime, i have built a viewhelper, that converts the object to 
an array. Kind of mix between for and alias viewhelper.

The relation to the dam records is working pretty good with current SVN 
version, though i had to apply the "foreign_table" fix. I created the 
TCA settings manually, but i think the config that you can get from 
txdam_getMediaTCA should also work.

Greets,
Andreas


More information about the TYPO3-project-typo3v4mvc mailing list