Hi All,
I have some jsp code to be converted to Sightly. Here is what I try to achieve, display a multi-col drawer:
col1-item1 col2-item1
col1-item2 col2-item2
<!--s1--> <!-- s1-->
col1-item3 col2-item3
col1-item4 col2-item4
Where s1 is a separator. JSP code:
// iterate the menu as column
// - set blockOpen=false
<ul><li class="main-nav__sub-col"><ul>
<c:forEach items="${column}" var="item">
<c:if test="${item.breakGroup and blockOpen}"></ul></li></ul><ul><li class="main-nav__sub-col"><ul></c:if>
<li><a href="${item.url}">${item.title}</a></li>
<c:set var="blockOpen" value="${true}" />
</c:forEach>
</ul></li></ul>
Converting to Sightly:
// iterate menu as column, just ignore blockOpen to make it simple
<ul><li class="main-nav__sub-col"><ul>
<sly data-sly-list.item="${column}">
<sly data-sly-set.itemTitle="${item.title}" /><!-- datapoint: ${item.breakGroup} -->
<sly data-sly-test="${item.breakGroup}"><!-- pivot-tag --></ul></li></ul><ul><li class="main-nav__sub-col"><ul><!-- /end pivot-tag --></sly>
<li><a href="#" target="${item.target}">${itemTitle @ content='html'}</a></li>
</sly>
</ul></li></ul>
The </ul> tag near <!--pivot-tag--> will close the condition and never reach ${itemTitle @ content='html'}
I tried this by breaking the close tags and open tags:
<sly data-sly-test....>${'</ul></li></ul>' @ context='html'}</sly> // followed by <ul><li...><ul>
It just ignores the code, printing out nothing.
Much appreciated!
-kt