Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Editable template association with Policies

Avatar

Level 3

For the static template, the design is stored at /etc/designs/<my-site>/jcr:content/<page-component-name>/<component-name> (if the page has a design path of /etc/designs/<my-site>) or/etc/designs/default/jcr:content/<page-component-name>/<component-name>

For editable template, design is stored at /conf/<your-project>/settings/wcm/policies.

So, In case of editable templates,only one template specific configuration(i.e. policies) per template can be there.

But, it is not the case with the static template, where more than one template-specific configurations (i.e. provide one separate design) can be associated with the template.

Template Name

Static Template

Editable Template

Design

T1/etc/designs/<site-name>/fr/jcr:content/landingpage/conf/<project-name>/settings/wcm/policies/t1/etc/design/<project-name>/fr
T1/etc/designs/<site-name>/us/jcr:content/landingpage/conf/<project-name>/settings/wcm/policies/t1/etc/design/<project-name>/us

How the above use case can be solved for the Editable template, wherein I want more than 1 policies (or config)  per template depending on the designs.

1 Accepted Solution

Avatar

Correct answer by
Employee

When you create an editable template directory. You create a scope for templating. There, you will have a local list of policies. One can create as many policies as they want. Content Policies are meant to be reusable and portable. The content policy mechanism is leveraging the Conf Manager. This means that the policies can be located at many different places such as follows:

  • /conf/<my-template-folder>/settings/wcm/policies (project level)
  • /conf/global/settings/wcm/policies (global level)
  • /apps/settings/wcm/policies (customer level)
  • /libs/settings/wcm/policies (AEM Private level)

To have access to all the policies located under the previous paths at once, one must set the merge list property on the jcr:content under the local policies node such as:

/conf/<my-template-folder>/settings/wcm/policies/jcr:content/mergeList{Boolean}=true

tl;dr

The merging logic of the Conf Manager is as follows:

  1. going from the most unspecific config to the most specific
  2. start with the original set (list)
  3. then for each set (same config item name) from the different configs
  4. look at the currently merged set (a) and the next one (b), item by item
  5. and decide what happens with the item, based on its node/page name:
    1. new item in (b) will be added to the set (a)
    2. existing item (a) will be replaced by same name item (b) if that one has a jcr:content child
    3. existing item (a) will get removed if there is a same name item in (b) without any jcr:content child

View solution in original post

0 Replies

Avatar

Level 10

TO clarify - you believe there is missing information from the docs?

Avatar

Level 3

smacdonald2008 ,

Let me know when I can get the update on the above.

Avatar

Correct answer by
Employee

When you create an editable template directory. You create a scope for templating. There, you will have a local list of policies. One can create as many policies as they want. Content Policies are meant to be reusable and portable. The content policy mechanism is leveraging the Conf Manager. This means that the policies can be located at many different places such as follows:

  • /conf/<my-template-folder>/settings/wcm/policies (project level)
  • /conf/global/settings/wcm/policies (global level)
  • /apps/settings/wcm/policies (customer level)
  • /libs/settings/wcm/policies (AEM Private level)

To have access to all the policies located under the previous paths at once, one must set the merge list property on the jcr:content under the local policies node such as:

/conf/<my-template-folder>/settings/wcm/policies/jcr:content/mergeList{Boolean}=true

tl;dr

The merging logic of the Conf Manager is as follows:

  1. going from the most unspecific config to the most specific
  2. start with the original set (list)
  3. then for each set (same config item name) from the different configs
  4. look at the currently merged set (a) and the next one (b), item by item
  5. and decide what happens with the item, based on its node/page name:
    1. new item in (b) will be added to the set (a)
    2. existing item (a) will be replaced by same name item (b) if that one has a jcr:content child
    3. existing item (a) will get removed if there is a same name item in (b) without any jcr:content child

Avatar

Level 3

Hi patrickf14763699 ,

Can i associate different policies for the same Template based on different designs?

Avatar

Employee

Hi rawvarun,

No, the content policy is basically the equivalent of the design. Your are going to have one content policy where you previously had a design node with a static template.

Avatar

Level 1

Based on locations specific site, i want to add a policy to the common template which already has common components.

Can this be done by adding multiple cq:policy be added to the template?