2016-10-21 10 views
1

내을 Liferay 6.2 EE 웹 콘텐츠 템플릿 내에서 나는 다음과 프리 마커 코드가 있습니다을 Liferay 프리 마커 목록 태그 - 속도 대응

<#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> 

불행하게도 우리가 속도로 전환해야합니다.

freemarkers 목록 태그를 Velocity로 변환하는 가장 좋은 방법은 무엇입니까?

나는 이미 다른 채택 모든 (태그, 메소드 호출은 ... 경우)

하지만 난 목록 태그 몇 가지 문제가 있습니다.

나는 속도에 foreach는 함께하려고 노력하지만 난 실패 ...

감사 속도에서

답변

1

을은 다음과 비슷한 모습이 될 것입니다

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

감사합니다 마이클. 그것은 지금 매력처럼 작동합니다. – HelmutSteiner

+1

그냥 질문 : 형제 목록이 비어 있는지 확인해야하는 이유는 무엇입니까? 빈 목록을 반복 할 수 없습니까? – brandizzi

+0

아니요, 값이있는 티저 헤더가 있는지 확인하십시오. – Michael