Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Adobe CQ/AEM: Add filter by tag to the query builder (asset share)
<tab4
jcr:primaryType="nt:unstructured"
title="Filter"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<tagFilter
jcr:primaryType="cq:Widget"
name="./tagFilter"
fieldDescription="Add tags to filter the result set."
fieldLabel="Filter by tags"
xtype="tags"/>
</items>
</tab4>
// filter by tags:
String[] tags = properties.get("tagFilter", String[].class);
<%
for (int i = 0; i < tags.length; i++) {
String tag = tags[i];
%>
qb.addHidden("<%=i%>_tag.property", "jcr:content/metadata/cq:tags");
qb.addHidden("<%=i%>_tag.property.1_value", "<%=tag%>");
/* qb.addHidden("<%=i%>_tag.p.or", "true"); */
<%
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment