2017-05-16 4 views
0

Webコンテンツを作成するためのテンプレート用の構造体があります。 Listという名前のテキストの親要素で、Itemという名前の反復可能な子要素があります。 enter image description hereLiferayのWebコンテンツマネージャで反復可能な要素を繰り返し処理できません

2つ以上の要素を追加しようとすると、テンプレートですべてを表示できません。 Itemの最初の要素のみを表示します。ここ はそれで私のテンプレート

<#if Information.getSiblings()?has_content> 
<#list Information.getSiblings() as information> 
    <h1>${information.getChild('Title').getData()}</h1> 
    <p>${information.getChild('Description').getData()}</p> 
    <ul> 
    <#list information.getChild('List').getSiblings() as item> 
    <li>${item.getChild('Item').getData()}</li> 
    </#list> 
    </ul> 
    </#list> 

UPD ディールです。これは

<#if Information.getSiblings()?has_content> 
<#list Information.getSiblings() as information> 
    <h1>${information.getChild('Title').getData()}</h1> 
    <p>${information.getChild('Description').getData()}</p> 
    <ul> 
    <#list information.getChild('List').getChild('Item').getSiblings() as item> 
    <li>${item.getData()}</li> 
    </#list> 
    </ul> 
    </#list> 

答えて

1

は、私はあなたがgetSiblings()

何かgetSiblings()を使用して

<#if parent.getChildren()?has_content> 
    <#list parent.getChildren() as information> 
     ... 
    </#list> 
</#if> 

ようにあなたがmissigしているのではなく、 getChildren()を用いた情報構造をナビゲートするべきだと思い、リスト内のすべての項目が表示されますです"兄弟"の1人

+0

あなたの答えに感謝します。しかし、私は解決策を見つけた。アップデートをチェック! –

関連する問題