I'm writing my first extbase extension for TYPO3 with nested models at the moment.
Following models exists:
Author - attributes: name and description
News - attributes: title, date, author
The author is included in the news model like this
/**
* @var Tx_Extbase_Persistence_ObjectStorage<Tx_Simplenews_Domain_Model_Author>
* @lazy
* @cascade remove
**/
protected $author = 0;
Debugging in Fluid also works, but the author object has an key uuid ("000000007d9412bd000000000217f7d0" for example), which changes on every request.
I just want to show the author's name on every news. One name.
So i have to loop trough the author object, to find the key and display the name like this:
<f:for each="{oneNews.author}" as="author">
<td>{author.name}</td>`
</f:for>
Is there a better solution for this?
<f:for each="{news}" as="oneNews">
<td>{oneNews.author.name}</td>
</f:for>
won't work.
Thanks in advance!
$authors
? Post the whole News model class. – Rico Leuthold