Liferay freemarker列表标记-速度对应项

Liferay freemarker列表标记-速度对应项,liferay,liferay-6,velocity,freemarker,Liferay,Liferay 6,Velocity,Freemarker,在我的Liferay 6.2 EE Webcontent模板中,我有以下freemarker代码: <#list teaserHeader.getSiblings() as teaser_header> <#if getterUtil.getBoolean(teaser_header.teaserVisible.getData())> <h2 class="section-headline">${teaserHeader.getData

在我的Liferay 6.2 EE Webcontent模板中,我有以下freemarker代码:

<#list teaserHeader.getSiblings() as teaser_header>
    <#if getterUtil.getBoolean(teaser_header.teaserVisible.getData())>
        <h2 class="section-headline">${teaserHeader.getData()?html}</h2>
            <div class="inner-15">
                <div class="general-wrapper inner-15-content bound" >
                    <#if teaser_header.teaserImage.getData() != "">
                    <div class="product-image-wrapper left">
                        <img src="${teaser_header.teaserImage.getData()}" width="" height=""/>
                    </div>
                    </#if>
                    <div class="product-teaser-info left">${teaser_header.teaserContent.getData()}</div>
                    <div class="clearfix"></div>
                </div>
            </div>
    </#if>
</#list>

${teaserHeader.getData()?html}
${striser_header.trisercontent.getData()}
不幸的是,我们不得不转向速度

将freemarkers列表标记转换为Velocity的最佳方法是什么?

我已经采用了所有其他方法(如果标记、方法调用等)

但是我对列表标签有一些问题

我试着用foreach在速度上做,但失败了


感谢您,在velocity中,它应该是这样的:

#if (!$teaserHeader.getSiblings().isEmpty())
    #foreach ($teaser_header in $teaserHeader.getSiblings())
        ...
    #end
#end

只是一个问题:为什么我们要检查兄弟姐妹列表是否为空?它会在一个空列表上迭代失败吗?不会,只是检查是否有一个带值的TriserHeader