Expand my Community achievements bar.

SOLVED

Duplicate main editable template and all pages using that template

Avatar

Level 1

We’re trying to replicate/duplicate 70+ articles which use a template with an experience fragment as header. We want to duplicate, not replace, the same articles and content but using a different experience fragment as header. 

 

Here are the steps we tried to replicate the article with different experience fragment:

  1. Create new experience fragment – make copy of existing fragment and made updates from there
  2. Create a new article template -- copying existing article template, then update experience fragment to new fragment

 

Is there a way we can duplicate the template and all pages that use this template? From there, I believe we can make changes to the editable template. We need to streamline the duplication process since we have 70+ articles using this template/experience fragment.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Kiran_Vedantam 

 

Scenario here is to duplicate, not replace, the same articles and content but using a different experience fragment as header. Both the content old and new(with updated XF) need to exist together and the template uses a XF as a header. This can only be handled by creating a new or duplicating the existing template and the new template would refer to either the new XF or the variation of it.

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @aym2 

 

Based on your requirement, here are the few steps that you can try:-

 

1. Create a new editable template. Either copy from the existing one or create a new one and author it with correct experience fragment.

2. Copy and paste all the 70 pages from the old template.

3. Change the below properties in page's jcr:content to make it work

cq:template

 sling:resourceType

 

Since there are only 70 pages, you can go to CRXDE and manually update the properties as mentioned above but you can also leverage Groovy script to update the template.

 

Hope this helps.

Avatar

Community Advisor

@Kiran_Vedantam You can go to CRXDE and change the template resource type.

 

AvinashGupta01_0-1670438254111.png

 

Also, ACS commons provide a utility to update the sling:resourceType and cq:Template properties in bulk

 

https://adobe-consulting-services.github.io/acs-aem-tools/features/csv-resource-type-updater/index.h...

Avatar

Community Advisor

Hi @aym2 

 

For the XF, you can either create a new XF or a variation of the existing XF.

 

For the duplication and replacement of the old XF, the best way I see is to manually/programmatically update the XF path once the duplication is done.

 

If you go with a new template approach, you wouldn't be able to update the page template/resourceType as per the documentation: https://experienceleague.adobe.com/docs/experience-manager-65/authoring/authoring/managing-pages.htm...

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Avatar

Correct answer by
Community Advisor

Hi @Kiran_Vedantam 

 

Scenario here is to duplicate, not replace, the same articles and content but using a different experience fragment as header. Both the content old and new(with updated XF) need to exist together and the template uses a XF as a header. This can only be handled by creating a new or duplicating the existing template and the new template would refer to either the new XF or the variation of it.