Ben Newman
Ben Newman

Reputation: 33

Limiting allowed components in a template in cq5

I have a template that I want to limit to only using a certain subset of components. I've created the template, set the components I want to use in design mode and everything looks great, but when I export that template and install it on another cq5 instance the component list that I've set for that template vanish. Any idea how to get them to stick?

Upvotes: 3

Views: 4549

Answers (2)

Alisneaky
Alisneaky

Reputation: 215

The above answer is correct, but if you need more info, as part of the template implementation, you can define the list of components that will be rendered in the sidekick for your template by defining the following property.

components="[/libs/foundation/components/text,/libs/foundation/components/textimage]">

This will sit under the following node (xml format here)

<TEMPLATENAME jcr:primaryType="nt:unstructured">
    <content
            jcr:lastModified="{Date}2014-04-11T13:04:48.855+10:00"
            jcr:lastModifiedBy="admin"
            jcr:primaryType="nt:unstructured"
            sling:resourceType="/libs/foundation/components/parsys"
            components="[/libs/foundation/components/text,/libs/foundation/components/textimage]">
        </content>
</TEMPLATENAME>

As long as you take this with your project to another instance, you'll keep the settings.

always take /etc/designs/projectDesignName directory with you

Upvotes: 2

Jan Kuźniak
Jan Kuźniak

Reputation: 308

The component list is saved in your design page. A design page is a page of a "Design Page" template. You should create one for each site / project, and associate it with your page (or page's parent, or page parent's parent) using the page properties: Advanced -> Design, and then export alongside your template.

Upvotes: 0

Related Questions