Skip to content

Instantly share code, notes, and snippets.

@UberNick
Created October 21, 2013 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UberNick/7082171 to your computer and use it in GitHub Desktop.
Save UberNick/7082171 to your computer and use it in GitHub Desktop.
<%@include file="/libs/foundation/global.jsp"%>
<%@page import="java.lang.Iterable"%>
<%@page session="false" %>
<%
String bestsellerPath = "/content/geometrixx/en/products/bestsellers/jcr:content/par/";
Iterable<Resource> bestsellers = resourceResolver.getResource(bestsellerPath).getChildren();
int index = 0;
for (Resource bestseller : bestsellers) {
if (index % 2 == 0){
%>
<div class="parsys_column cq-colctrl-lt0">
<%
}
%>
<div class="parsys_column cq-colctrl-lt0-c<%= index % 2 %>">
<sling:include path="<%= bestseller.getPath() %>" />
</div>
<%
if (index % 2 == 1){
%>
</div>
<%
}
index++;
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment