Expand my Community achievements bar.

SOLVED

How to restrict the parsys to specific components

Avatar

Level 3

I have a requirement where we need to restrict the author to add only specific components to parsys. 

I understood from few sites that we can achieve this through design page (adding specific components to 'Components' property) but somehow its not working for me. Am i missing anything here?

Appreciate your help!

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi

Please have a look at these reference community posts:-

UI solution :- https://docs.adobe.com/docs/en/aem/6-2/author/page-authoring/default-components/designmode.html#Enab... Components - Touch-Optimized UI

Link:- http://stackoverflow.com/questions/23275062/restrict-the-components-in-aem-5-6-1

// Restrict the components     

    In CRXDE, under /etc/designs/[your design]/jcr:content, you can define nodes to represent each of your templates & their paragraphs & list the allowed components for each.

    The format is a node for each template that contains a node for each parsys (both [nt:unstructured]).

    The parsys node then has a sling:resourceType defined of foundation/components/parsys and a components property of String[]. For an example, check out how the Geometrixx one is defined:     http://localhost:4502/crx/de/index.jsp#/etc/designs/geometrixx/jcr%3Acontent/contentpage/par

    You could then extract this via VLT, which gets stored as a .content.xml file under etc/designs/[your design].

    Alternatively, you can create that file by hand, too. E.g. the following would define 'Your Design' as allowing default "text" and "image" components on the "yourParsys" paragraph of "yourTemplate".

    <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
              xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
              jcr:primaryType="cq:Page">
        <jcr:content
          cq:template="/libs/wcm/core/templates/designpage"
          jcr:primaryType="cq:PageContent"
          jcr:title="You Design">
            <yourTemplate jcr:primaryType="nt:unstructured">
                <yourParsys
                  jcr:primaryType="nt:unstructured"
                  sling:resourceType="foundation/components/parsys"
                  components="[foundation/components/text,foundation/components/image]"/>
            </yourTemplate>
        </jcr:content> 
    </jcr:root>
    This allows you to move this file across instances (e.g when deploying a CRX package) so that you don't have to configure environments individually & which components are allowed where can also be     managed by version control.

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// How to restrict components in parsys

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// How to restrict components in a particular parsys ?

  Make sure to configure the property "components" as type string[] with list of all the components.As an example for geometrixx you can refer /etc/designs/geometrixx/jcr:content/contentpage/par/@components.  

 

~kautuk   



Kautuk Sahni

View solution in original post

6 Replies

Avatar

Correct answer by
Administrator

Hi

Please have a look at these reference community posts:-

UI solution :- https://docs.adobe.com/docs/en/aem/6-2/author/page-authoring/default-components/designmode.html#Enab... Components - Touch-Optimized UI

Link:- http://stackoverflow.com/questions/23275062/restrict-the-components-in-aem-5-6-1

// Restrict the components     

    In CRXDE, under /etc/designs/[your design]/jcr:content, you can define nodes to represent each of your templates & their paragraphs & list the allowed components for each.

    The format is a node for each template that contains a node for each parsys (both [nt:unstructured]).

    The parsys node then has a sling:resourceType defined of foundation/components/parsys and a components property of String[]. For an example, check out how the Geometrixx one is defined:     http://localhost:4502/crx/de/index.jsp#/etc/designs/geometrixx/jcr%3Acontent/contentpage/par

    You could then extract this via VLT, which gets stored as a .content.xml file under etc/designs/[your design].

    Alternatively, you can create that file by hand, too. E.g. the following would define 'Your Design' as allowing default "text" and "image" components on the "yourParsys" paragraph of "yourTemplate".

    <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
              xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
              jcr:primaryType="cq:Page">
        <jcr:content
          cq:template="/libs/wcm/core/templates/designpage"
          jcr:primaryType="cq:PageContent"
          jcr:title="You Design">
            <yourTemplate jcr:primaryType="nt:unstructured">
                <yourParsys
                  jcr:primaryType="nt:unstructured"
                  sling:resourceType="foundation/components/parsys"
                  components="[foundation/components/text,foundation/components/image]"/>
            </yourTemplate>
        </jcr:content> 
    </jcr:root>
    This allows you to move this file across instances (e.g when deploying a CRX package) so that you don't have to configure environments individually & which components are allowed where can also be     managed by version control.

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// How to restrict components in parsys

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// How to restrict components in a particular parsys ?

  Make sure to configure the property "components" as type string[] with list of all the components.As an example for geometrixx you can refer /etc/designs/geometrixx/jcr:content/contentpage/par/@components.  

 

~kautuk   



Kautuk Sahni

Avatar

Level 3

Hi Kautuk,

Sorry, I was out from work past one week. I will check this out and let you know in case of any questions.

Avatar

Administrator

Yes, please let us know, if it works for you or not.

~kautuk



Kautuk Sahni

Avatar

Administrator

Is it working now ?

~kautuk



Kautuk Sahni

Avatar

Level 3

Sorry, was out again. Yeah, it was working. Thanks much for your help. Much appreciated.

Avatar

Level 3

It was working like a gem, thanks Kautuk.