I have a series of parsys present in my page's footer. At the same time, I want to impose component restriction to all these via etc/designs/projectname/content.xml. This goes like this:
JSP:
<c:forEach var="i" begin="0" end="${properties.numberOfFooterLinks-1}">
<div class="small-6 medium-4 large-2 columns">
<cq:include path="./footerPar${i}"
resourceType="foundation/components/parsys" />
</div>
</c:forEach>
XML:
<footer jcr:primaryType="nt:unstructured">
<footerPar0 jcr:primaryType="nt:unstructured"
sling:resourceType="foundation/components/parsys"
components="[group:footerComp]">
<section jcr:primaryType="nt:unstructured"/>
</footerPar0>
</footer>
This works only for the parsys footerPar0 but not for the rest (footerPar1, footerPar2 etc). I am stuck in achieving this. Is there a way to achieve it without repeating the parsys's names till the end of the loop count? Thanks.
I haven't found an elegant way to do this either. One solution is to dynamically remove allowed components using a JavaScript listener & add back in the components that you want to allow.
E.g. overriding parsys itself under
/apps/foundation/components/parsys
, add an_cq_editConfig.xml
, like:Obviously this is quite far reaching, as the listener is affecting all instances of parsys (though targetting your footerPar by name within the function.)
If you don't already have live content in these fields, you could maybe create your own resource type that uses parsys as a supertype, for better level of control.