List based on a template
Create list of nodes that uses a specific template
template = "magnolia-module:path/to/template"
query = "select * from [mgnl:content] where [mgnl:template] = '"+template+"'";
result = QueryUtil.search("website", query, javax.jcr.query.Query.JCR_SQL2, "mgnl:content");
result.each{ def component ->
println( component.getPath() );
}
return "--- end"
Contact the author