[TYPO3-english] Help with inline for each

bernd wilke t3ng at bernd-wilke.net
Mon Oct 26 09:14:22 CET 2015


Am 22.10.15 um 23:34 schrieb Simon Browning:
> Thanks Richard
>
> isfirst and islast will only give me the space at the beginning or end
> of the list of categories though, won't it? It might work though, as
> most articles won't have more than two or three categories
>
> I haven't been very succesful nesting with inline fluid, below is what I
> have, how would you work the iterator into it?
>
> <div class="element-item {category.title -> f:for(each:
> newsItem.categories, as: 'category')}  element-item  col-md-6
> img-portfolio article articletype-{newsItem.type}{f:if(condition:
> newsItem.istopnews, then: ' topnews')}" itemscope="itemscope"
> itemtype="http://schema.org/Article">

for the CSS-Classlist commata are evil, and an additional space at the 
end does not disturb anything.

for a list outside of HTML-Tags(attributes) I would prefer the 
tag-notification of the viewhelpers:

<span class="categories"><f:for each="{newsItem.categories}" 
as="category" iteration="iterator">
{category.title}<f:if condition="{iterator.last}"><f:else>,</f:else></f:if>
</f:for></span>

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


More information about the TYPO3-english mailing list