我正在尝试创建FLuID循环,它将显示带有4张图片的块。我想实现这样的效果:
问题在于我是FLUID新手,不知道如何只用4个元素制作循环。我的FLUID循环代码如下:
所以每个循环只显示一张(而不是4张)图像。有什么建议吗?
感谢任何帮助。
<div class="carousel-inner">
<div class="item active">
<div data-target="#carousel" data-slide-to="0" class="thumb"><img src="http://image1.jpg"></div>
<div data-target="#carousel" data-slide-to="1" class="thumb"><img src="http://image2.jpg"></div>
<div data-target="#carousel" data-slide-to="2" class="thumb"><img src="http://image3.jpg"></div>
<div data-target="#carousel" data-slide-to="3" class="thumb"><img src="http://image4.jpg"></div>
</div>
<div class="item">
<div data-target="#carousel" data-slide-to="4" class="thumb"><img src="http://image5.jpg"></div>
<div data-target="#carousel" data-slide-to="5" class="thumb"><img src="http://image6.jpg"></div>
<div data-target="#carousel" data-slide-to="6" class="thumb"><img src="http://image7.jpg"></div>
<div data-target="#carousel" data-slide-to="7" class="thumb"><img src="http://image8.jpg"></div>
</div>
</div>
问题在于我是FLUID新手,不知道如何只用4个元素制作循环。我的FLUID循环代码如下:
<div class="carousel-inner">
<f:for each="{paginatedAssets}" as="mediaAsset" iteration="iterator">
<f:if condition="{iterator.index} = 4">
<div class="item{f:if(condition: '{iterator.index} == 0', then: ' active')}">
<div data-target="#carousel" data-slide-to="{iterator.index}" class="thumb">
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAsset.alternative,title:mediaAsset.title,mediaAsset:mediaAsset,width:settings.album.thumb.width,height:settings.album.thumb.height,resizeMode:settings.album.thumb.resizeMode}" />
</div>
</div>
</f:if>
</f:for>
</div>
但它显示的内容类似于:
<div class="carousel-inner">
<div class="item active">
<div data-target="#carousel" data-slide-to="0" class="thumb">
<img title="Photo 1" alt="Photo 1" src="fileadmin/_processed_/csm_P1320323_f0d26808a1.jpg" width="800" height="600" />
</div>
</div>
<div class="item">
<div data-target="#carousel" data-slide-to="1" class="thumb">
<img title="Photo 2" alt="Photo 2" src="fileadmin/_processed_/csm_P1320326_d00a6dfa33.jpg" width="800" height="600" />
</div>
</div>
...
<div class="item">
<div data-target="#carousel" data-slide-to="n" class="thumb">
<img title="Photo n" alt="Photo n" src="fileadmin/_processed_/csm_P1234567_f001234567.jpg" width="800" height="600" />
</div>
</div>
</div>
所以每个循环只显示一张(而不是4张)图像。有什么建议吗?
感谢任何帮助。