[TYPO3-mvc] Fluid: Avoid iteration in <f:for each> loop, if condition is false

Martin Wagner martin.wagner.work at gmail.com
Tue Oct 15 12:23:14 CEST 2013


Hi Forum,

I create an app with several frontend users.

At the list view there should be only entries from the user show, which is logged in at the frontend and which are created by himself.


<f:widget.paginate objects="{stoerungsmeldungs}" as="paginstoerungsmeldungs" configuration="{itemsPerPage: 10}">
<f:for each="{paginstoerungsmeldungs}" as="stoerungsmeldung" iteration="iterator">
<f:if condition="{stoerungsmeldung.username} == <f:cObject typoscriptObjectPath='lib.feuser' />">
<f:then>
<div class="meListWrap">
<h2>Listeneintrag {stoerungsmeldung.username}</h2>
</div>
</f:then>
</f:if>
</f:for>
</f:widget.paginate>


lib.feuser contains the current logged-in user, {stoerungsmeldung.username} is the id of the creator.

So far it works. But there are not 10 list entries always, because the <f:for each> loop counts also, if the condition is false.

Is there a chance to get 10 entries per page, or is it impossible with Fluid and I have to make it with filters?

any help appreciated!


More information about the TYPO3-project-typo3v4mvc mailing list