Editable templates - Component policies are repetitive | Community
Skip to main content
Level 2
December 1, 2021
Solved

Editable templates - Component policies are repetitive

  • December 1, 2021
  • 2 replies
  • 1085 views

Hi All,

 

It is very repetative to assign component policies across all the editable templates. Early on you will have 5+ editable templates. In larger sites with 50+ page templates, adding a new component and it's style modifiers can take hours.

 

Is there a way to define in the cq_design_dialog a default component policy configuration?

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

Hi @davidb86179332 

 

You can

  1. try creating a template type and add all the components that are required there, then create the templates using that template type
  2. If the templates are already created, just add the required policies in your XML files and check in with your code. Even though it is a copy paste job, it would be an one time activity.

Hope this helps.

 

Thanks,

Kiran Vedantam.

2 replies

B_Sravan
Community Advisor
Community Advisor
December 2, 2021

you can do one thing, instead of addind style policies for each component, you can have one categorie name of all your component specific clientlibs. For example say "myapp.components". 

Embed this to your site client lib. That way, you can you use one single policy at page/template level.

Kiran_Vedantam
Community Advisor
Kiran_VedantamCommunity AdvisorAccepted solution
Community Advisor
December 2, 2021

Hi @davidb86179332 

 

You can

  1. try creating a template type and add all the components that are required there, then create the templates using that template type
  2. If the templates are already created, just add the required policies in your XML files and check in with your code. Even though it is a copy paste job, it would be an one time activity.

Hope this helps.

 

Thanks,

Kiran Vedantam.

Level 2
December 2, 2021

Thanks @kiran_vedantam I'll try the tempalte type method on the next fresh project