I've a list of objects (question-items), each with a property named category and title. (The list of objects is ordered by its category property)
With this Fluid Template I want to iterate over the question items:
<f:for each="{questions}" as="question">
<!-- every time category changes, display it as a new headline ??? -->
<!-- if (question.category != previousQuestion.category) ?.....? -->
<span>{question.title}</span>
</f:for>
How can I check, if the category property has changed in the for? The output should be something like this:
- Category-A
- Question
- Question
- Category-B
- Question
- Category-C
- Question
- Question
- Question
- ...