[TYPO3-english] Help with inline for each
Jigal van Hemert
jigal.van.hemert at typo3.org
Fri Oct 23 11:05:19 CEST 2015
Hi,
On 22/10/2015 23:34, Simon Browning wrote:
> 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">
<div class="element-item {f:if(condition: iter.isLast, then:
'{category.title}', else: '{category.title},') -> f:for(each:
newsItem.categories, as: 'category', iteration: 'iter')}" ..... >
This should give you a comma separated list of categories.
--
Jigal van Hemert
TYPO3 CMS Active Contributor
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-english
mailing list