【发布时间】:2018-02-13 11:28:18
【问题描述】:
我想让这段代码更灵活。
如您所见,这是 DCE 的代码。
所以我想通过循环或类似的方式添加引号。
https://gist.github.com/DarthKeks/f5b3c9c26f05f3a8dfbf127dee9f9b64
【问题讨论】:
我想让这段代码更灵活。
如您所见,这是 DCE 的代码。
所以我想通过循环或类似的方式添加引号。
https://gist.github.com/DarthKeks/f5b3c9c26f05f3a8dfbf127dee9f9b64
【问题讨论】:
在 DCE 中,您可以使用重复的部分。假设您使用变量 quote
创建了一个部分导航
例如:
<ol class="carousel-indicators">
<f:for each="{field.quote}" as="quote" iteration="iterator">
<li data-target="#quote-carousel" data-slide-to="{iterator.cycle}" {f:if(condition: '{iterator.isFirst} == 1', then: ' class="active"')}></li>
</f:for>
</ol>
旋转木马
这里也适用同样的原则:
<div class="carousel-inner" role="listbox">
<f:for each="{field.quote}" as="quote" iteration="iterator">
<div class="item{f:if(condition: '{iterator.isFirst} == 1', then: ' active')}">
<blockquote>
<f:format.html>{quote.expert}</f:format.html>
<small>{quote.expertName}</small>
</blockquote>
</div>
</f:for>
</div>
【讨论】:
您可以简单地使用 dce-containers 您的 qoutes 现在只需添加一个 标记/字段并将您的 DCE 字段加载到该标记/字段中。只要 DCE 项目是相同的类型,它就会循环。
【讨论】: