[TYPO3-english] Compare strings in fluid

bernd wilke t3ng at bernd-wilke.net
Mon Oct 7 12:31:15 CEST 2013


Am 01.10.13 10:40, schrieb Jeppe Donslund:
> After some time with google I think that groupedFor could solve my
> problem, but the field that I want to groud by is a category field and
> it doesn't seem to work. I have read that groupedFor doesn't work with
> objects. Is that my problem?

I don't know wether grouping can be done implicit.
But you can do it in the tradtional way explicit (with a little help of 
an additional viewhelper [1]) like this:

<v:var.set name="groupValue" value="--empty--" />
<f:for each="..." as="element" ...>
   <f:if condition="{groupValue} == {element.groupedvalue}">
     <f:else>
       <v:var.set name="groupValue" value="{element.groupedvalue}" />
       ... output group-heading ...
     </f:else>
   </f:if>
   ... output element values ...
</f:for>




[1] https://fedext.net/viewhelpers/vhs/Var/SetViewHelper.html

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list