Content migration from one template to the other | Community
Skip to main content
mia_kn
August 11, 2016
Solved

Content migration from one template to the other

  • August 11, 2016
  • 11 replies
  • 3415 views

Hi - I am new to AEM CMS development.I am working on a POC for automated content migration from one template to the other. Wanted to know if its possible in AEM . My naive approach when I heard about this POC was to create the content as components ( say with the required styling ) and just call the content component from the required components . Please correct me if I am wrong or if there is a better approach . Thank you .

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 antoniom5495929

You can create different view in AEM with usage of selectors.

What you can do is a template with 2 different view, configurable with page properties.

It could be a solution for you? if yes i can provide you some example code.

11 replies

smacdonald2008
Level 10
August 11, 2016

A template is simply a node in AEM that points to a cq:Component node where you define the markup of the page. When you are saying you automating content from one template to another - can you be more specific. What content are you moving?

mia_kn
mia_knAuthor
August 11, 2016

Thanks for replying . So the required scenario for this POC is . Say for a given home page , there are two different templates. The Content editors can use either template 1 or template 2. But any template they switch , the content should be automatically migrated . This is the requirement . So want to know if this is possible . If there is any reading material , related links please direct me to it . 

And thanks again . 

joerghoh
Adobe Employee
Adobe Employee
August 11, 2016

Hi,

I still don't see, what you need to do. So I assume, that your content authors used a template A to create their pages, but it should be switched to template B for some reasons. Is that assumption correct?

And what are you supposed to change then? Is the content structure of these 2 templates different?

 

Jörg

antoniom5495929
Level 7
August 12, 2016
        So what you need is just to have 2 different view of the same page? i.e. homepage?
kautuk_sahni
Community Manager
Community Manager
August 12, 2016

Hi 

Assuming that what "Jörg" wrote is your actual problem, then the solution i could think of is:-

1. You can reuse some of the component in you template :-

    Link:- http://stackoverflow.com/questions/22392147/cq5-preload-a-parsys-with-components

    Link:- http://suryakand-shinde.blogspot.in/2015/01/how-to-create-page-with-predefined.html

The concept here is, to create a page with predefined components.

~kautuk

Kautuk Sahni
mia_kn
mia_knAuthor
August 12, 2016

yes 

mia_kn
mia_knAuthor
August 12, 2016

yes - the requirement is that when the content authors choose template B instead of template A, then the content from template A should be automatically migrated to template B. So is this possible within AEM ? 

antoniom5495929
antoniom5495929Accepted solution
Level 7
August 12, 2016

You can create different view in AEM with usage of selectors.

What you can do is a template with 2 different view, configurable with page properties.

It could be a solution for you? if yes i can provide you some example code.

smacdonald2008
Level 10
August 12, 2016

YOu can pass me that sample and we can base a helpx community article on it. That looks like a great use case to capture to help the AEM community. Send to scottm@adobe.com. We can discuss further. 

mia_kn
mia_knAuthor
August 12, 2016

Yes - if its like a small demo that I can see and understand , then it will be really helpful. 

Thank you.