Expand my Community achievements bar.

Allow Components for Static template in AEM 6.5

Avatar

Level 4

Hi, I have a requirement to allow particular component inside Parsys for Static Template. How can we achieve this?

Whenever we create a page based on that template, it should allow to add that particular component in Parsys in edit mode.

7 Replies

Avatar

Level 4

Hello @Jagadeesh_Prakash, Thanks for replying. The article you mentioned is more focused on editable template and it does not tell about adding policy to add particular component from parsys.

Avatar

Community Advisor

Hi @Shivam153 ,

You should be able to allow components in static template. Just make sure you give the proper resource type path for the component that is being allowed.
So basically, in the apps folder where you have created your static template you should follow the type of structure.

 

 

<?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:description="Template with allowed components."
    jcr:primaryType="cq:Template"
    jcr:title="Static template"
    allowedPaths="[/content/. *]"
    ranking="{Long}100">
    <jcr:content
        jcr:primaryType="cq:PageContent"
        sling:resourceType="<your structure component path>">
        <logo
            jcr:primaryType="nt:unstructured"
            sling:resourceType="apps/components/structure/logo"/>
        <title
            jcr:primaryType="nt:unstructured"
            sling:resourceType="apps/components/content/title"/>
 </jcr:content>
</jcr:root>

 

So in the above allowed components are added inside the "jcr:content" . These are the dummy data you can replace it with your actual data.
Hope this helps!

Avatar

Level 4

@TarunKumar  Thanks for replying. For a single component to add, it will work, but I want to add a parsys and then need to restrict that particular component.

Avatar

Community Advisor

Hi @Shivam153 

 

Please check my answer here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/allowed-components-in-desi...

 

You can add the components in design mode and get the code from /etc.

 

Hope it helps!

Thanks,
Kiran Vedantam.

Avatar

Community Advisor

go on design mode of page, this will allow you to add/remove components for any parsys. design mode can be selected from authoring page and changing it from top right corner

Avatar

Level 4

Hi All, Thanks for all the response. I have found the solution for it.

Inside design folder, we can define following properties to get component in our responsive grid, By doing that, we don't have to manually add our component in design mode.

Shivam153_0-1678425370556.png