我已经创建了用于添加事件的结构和模板。
我所做的输入是:
除图像外,所有数据都正常显示。我首先给出的图像是针对每个事件显示的。
任何人都可以帮助我吗?
<root available-locales="en_US" default-locale="en_US">
<dynamic-element dataType="html" fieldNamespace="ddm" indexType="keyword" name="about_fe" readOnly="false" repeatable="false" required="false" showLabel="true" type="ddm-text-html" width="small">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[about fundraising]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element dataType="html" fieldNamespace="ddm" indexType="keyword" name="year_fe" readOnly="false" repeatable="true" required="false" showLabel="true" type="ddm-text-html" width="small">
<dynamic-element dataType="image" fieldNamespace="wcm" indexType="keyword" name="image_fe" readOnly="false" repeatable="false" required="false" showLabel="true" type="wcm-image" width="">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[select image for fundraise event]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element dataType="html" fieldNamespace="ddm" indexType="keyword" name="desc_fe" readOnly="false" repeatable="false" required="false" showLabel="true" type="ddm-text-html" width="small">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[enter description for the event]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<meta-data locale="en_US">
<entry name="label">
<![CDATA[enter the year and month]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
</root>
以下是我的模板代码:
#if (!$year_fe.getSiblings().isEmpty())
#foreach ($cur_year_fe in $year_fe.getSiblings())
<div class="pto_fund">
<div class="my_time">
<div class="mysection1"><h5>$cur_year_fe.getData()</h5></div>
</div>
<div class="mysection2">
<img src="$cur_year_fe.image_fe.getData()" height="200px" width="230px"/>
</div>
<div class="mysection3">$cur_year_fe.desc_fe.getData()</div>
</div>
<div class="clear">
</div>
#end
#end
示例输出
答案 0 :(得分:2)
我认为你可能会遇到生命问题: -
https://issues.liferay.com/browse/LPS-43553
https://issues.liferay.com/browse/LPS-51440
可能的解决方法是将"image_fe"
移到上一级(从可重复的图像开始,依此类推)。
HTH