Content Policy delegation for nested components? | Community
Skip to main content
Level 2
July 5, 2018

Content Policy delegation for nested components?

  • July 5, 2018
  • 3 replies
  • 4445 views

Hi,

when reuse of an existing component is not possible, the next best thing is to create a new composite component through assembly of existing components. However, when trying to do so, I seem to get into trouble when it comes to the content policy for this composite component (in the context of Editable Templates).

Suppose I were to create a composite component that nests a Text and an Image component. I could create a design dialog for this component, but obviously, the resulting content policy will have no effect on the content policy of the nested Text and/or Image components. So I was wondering if there is any way to accomplish this, e.g. by delegating the nested components to the content policy of the parent component.

I was also wondering if other AEM developers have faced this issue..

I did some digging myself and learned the following:

  • I found out that the "contentPolicyDelegatePath" request attribute seems force a component to use the content policy of another resource. However, I haven't tested this, and found no documentation about it, so I have no idea if it is meant to be used in this way.

  • If I would create an Editable Template with a responsive grid that allows editors to add Title, Image, and my new composite component to it. And if I would add a content policy to the Title and Image components, then this same policy would be applied to the ones nested in my composite component. I can see this resulting in confusing behaviour.
  • The previous bullet actually illustrates a more general missing feature that seems highly related to what I'm asking about.
    Suppose I also allow a responsive grid in addition to the Text, Image and composite components. Then I can add a policy to the responsive grid, allowing for instance the Text component.
    However , I have no way to specify a different policy for this Text component. Just like with the one nested inside my composite component, it will get the Text policy that was set higher up the hierarchy.
    In other words, it is only possible to set policies on template structure nodes, and a single policy for each of their allowed (grand-)children. There is no way to differentiate further in the hierarchy of the allowed (grand-)children.

Regards,

Steven

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

smacdonald2008
Level 10
July 5, 2018

"If I would create an Editable Template with a responsive grid that allows editors to add Title, Image, and my new composite component to it. And if I would add a content policy to the Title and Image components, then this same policy would be applied to the ones nested in my composite component. I can see this resulting in confusing behaviour."

Assume you place a layout container on an editable template. You then have to Define a policy to specifies which  components are allowed to be used within that layout container. Typically this can be done using Component Groups. 

Why is this confusing?

Level 2
May 8, 2024

I am facing this issue as well. Any resolution would be greatly appreciated.

June 7, 2019

Any update on this one? We are still having this problem...

April 21, 2023

Same here, any update on this?

April 21, 2023

Did you find out if the contentPolicyDelegatePath works out for what you need? Facing the same issue