/hst:hst/hst:configurations/myproject/hst:pages/sportspage/main + gallery [hst:component] - hst:componentclassname = com.gec.components.GalleryComponent - hst:template = gallery
/hst:hst/hst:configurations/myproject/hst:templates
+ gallery [hst:template] - hst:renderpath = freemarker/myproject/gallery.ftl
----------
[INFO] [talledLocalContainer] ==> ${result.count} [on line 5, column 4 in WEB-INF/freemarker/scc/gallery.ftl]
[INFO] [talledLocalContainer] ----------
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] Java backtrace for programmers:
[INFO] [talledLocalContainer] ----------
[INFO] [talledLocalContainer] freemarker.template.TemplateException: Expected hash. result evaluated instead to freemarker.template.SimpleSequence on line 5, column 6 in WEB-INF/freemarker/scc/gallery.ftl.
[INFO] [talledLocalContainer] at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
For testing, I tried to access one of the HippoGalleryImageSet in the ftl template and I can!
(see below)
What am I missing?
@ParametersInfo(type = EssentialsDocumentListComponentInfo.class)
public class GalleryComponent extends EssentialsListComponent {@Override
public void doBeforeRender(final HstRequest request,
final HstResponse response)
throws HstComponentException {
l.info("doBeforeRender");
HippoDocumentBean subject = request.getRequestContext().getContentBean(HippoDocumentBean.class);
Sports sports = (Sports) subject;
HippoFolderBean sportsGallery = (HippoFolderBean) sports.getGallery();
List<HippoGalleryImageSet> images = sportsGallery.getDocuments(HippoGalleryImageSet.class);
for (HippoGalleryImageSet image: images) {
l.info("Image is "+image.getFileName());
}
request.setAttribute("result", images);
request.setAttribute("document", images.get(0));
}
}
<#include "/WEB-INF/freemarker/include/imports.ftl">
<h5>gallery</h5>
${document} <!-- this object is printed out: org.hippoecm.hst.content.beans.standard.HippoGalleryImageSet@f418cf9d --><#if result??>
<p>${result.count}</p>
</#if>
<ul id="images">
<#list result.items as item>
<@hst.link var="img" hippobean=item/>
<li>
<img src="${img}" alt="${item.fileName}" />
</li>
</#list>
</ul>
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.