Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM 6.4 - Editable templates - Multiple parsys inside single component

Avatar

Level 1

Hi,

Regarding editable templates, I'm having a problem setting up two different lists of allowed components for two distinct parsys, which are included a single component.

I've tried in three ways:

- Adding the old "page resType --> parName --> components: [...]" configuration under project design folder (now in apps, not etc)

- Component wrapper, with 2 parsys. Editing the list of allowed components for this specific component works, but i have the same list on both the parsys.

- Component wrapper, which includes 2 other components (wrapper-right, wrapper-left). Left and right extend wcm responsivegrid component with his design dialog OOB. Editing right and left list of allowed components results in no components available on both responsive grids.

Is there any way to configure two separate lists of components for the 2 parsys ?

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 1

Thank you, I've succeded using another method.

For anyone interested:

- Created two wrapper components (wrapperLeft, wrapperRight, both with superType --> responsivegrid), included by wrapper component (with data-sly-resource), instead of referencing directly two responsivegrid

- Created and linked two different policies for wrapperLeft and wrapperRight

Now, if I add multiple wrapper components to the root parsys, the responsive grids follow these policies rules

Thanks dgordon86​ and @Arun Patidar for the suggestions

View solution in original post

7 Replies

Avatar

Community Advisor

Hi,

You can create different policies for different parsys.

please check component level policy at AEM Developer Learning : Dynamic (Editable) Templates in AEM 6.3 : Part-1



Arun Patidar

Avatar

Level 1

I know I can set different policies for different parsys, but I need to set different policies for two different parsys that may be added to the page main parsys.

These two parsys or responsive grids are inside a single component.

This is the situation:

Page
|--- Main Parsys ---> Policy ( group1 - Contains wrapper component)

So if I add a wrapper component to the main parsys, I'll have two new parsys. I need to set two different policies for these parsys, that are not present in the initial content of the page, but they are optional (included in the wrapper component).

Page

|--- Main Parsys ---> Policy ( group1 - Contains wrapper component)

         |---->Wrapper component

                         |----> Parsys Left ( component group 2 )

                         |----> Parsys Right( component group 3)

Also with the help of the article I've not been able to set these policies.

Thank you anyway

Avatar

Community Advisor

Hi,

I think if you are using other parsys inside then you will get the default components because policy is set for main component.

you can set policy for other 2 parsys component but policy will be effective if you drop that component as a main component in other parsys.

Thanks

Arun



Arun Patidar

Avatar

Employee Advisor

I'm assuming your wrapper component includes the Parsys Left/Right via a data-sly-resource or cq:incude? These will be artificial resources at first and the Template editor does not seem to like artificial resources. The solution is to make sure the nodes exist, either by manually adding them in the Template Type definition or by using something like cq:template in the component definition. Check out how Asset Share Commons does this:

Root Component - asset-share-commons/root.html at develop · Adobe-Marketing-Cloud/asset-share-common...

Template Type Structure -asset-share-commons/.content.xml at develop · Adobe-Marketing-Cloud/asset-s...

Avatar

Correct answer by
Level 1

Thank you, I've succeded using another method.

For anyone interested:

- Created two wrapper components (wrapperLeft, wrapperRight, both with superType --> responsivegrid), included by wrapper component (with data-sly-resource), instead of referencing directly two responsivegrid

- Created and linked two different policies for wrapperLeft and wrapperRight

Now, if I add multiple wrapper components to the root parsys, the responsive grids follow these policies rules

Thanks dgordon86​ and @Arun Patidar for the suggestions

Avatar

Level 10

Nice solution - thank you for posting!

Avatar

Level 1

I created a component specific policy and manually added components [] property and added the required component group also.

There are three parsys in my components and the only above added components are allowed in those parsys.

 

How I will add another component or group without crx/de or code change because the Allowed Component policy is available only on the template level?