How to limit components in a template without design dialog
Does anyone know how to define a list of components in a template, so when an author creates a page, author can only choose a components from the list?
I tried to put components property in my template called limit as below:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Template"
jcr:title="Limit Template"
jcr:description="Limit template with predefined components"
allowedPaths="/content(/.*)?"
ranking="{Long}2040">
<jcr:content
cq:designPath="/etc/designs/mysite"
jcr:primaryType="cq:PageContent"
components="[/apps/mysite/components/content/article,/apps/mysite/components/content/button,/apps/mysiten/components/content/image]"
sling:resourceType="mysite/components/pages/limit">
</jcr:content>
</jcr:root>
I see the components property and value in the /mysite/templates/limit/jcr:content. But when I create a page, I didn't see the predefined components.
Thank you for your help.