I’m using typo3 and learning how it works. I’m trying to build a table with some pictures, but all that I have tried didn’t work. So I will like to have some suggestions about how this can be accomplished.
Here is what I have:
On my controller I get a Tx_Extbase_Persistence_QueryResult with a group of pictures:
$fileElements = $fileElementRepository->getFileElementsByNumberOf($id, $numberOfElements);
$this->view->assign('fileElements', $fileElements);
And here is what I do with them on my index.html:
<table>
<tr>
<f:for each="{fileElements}" as="satArc">
<td>
<f:image src="{satArc.filePath}" alt="{satArc.linkText}" />
</td>
</f:for>
At the moment I get a row with all the pictures available. Because I have the for loop inside the tag. But I would like to find a way to group them in rows with 4 pictures. But I haven’t figure it out how to divide in groups of 4 elements the queryResult.
I hope this is clear enough, otherwise ask.
Thanks for reading 🙂
You can use
So you can close the row and start a new one.