AEM MSM - Retrieve Language Copy by API



I'm working with the MSM feature to define a site like this:

  • /es/es/buy
  • /es/en/buy
  • /en/es/buy
  • /en/en/buy
  • /language-masters/es/buy
  • /language-masters/en/buy

When a user visits the page /es/es/buy, I would like to retrieve the path of the language copy (/es/en/buy/) to implement a custom language navigation and use it in the "alternate" meta for SEO purposes too.

This second part is related with link tags at head:

<link rel="canonical" href="/es/prensa..."/>
<link rel="alternate" hreflang="x-default" href="/en/press..."/>
<link rel="alternate" hreflang="es" href="/es/prensa..."/>
<link rel="alternate" hreflang="en" href="/en/press..."/>


Is it possible using the Java API? I've used the next API classes and I did't find the way:


Also, I've detected that if I change the name of a language copy, we loose the reference in the touch-enabled UI. The page doesn't appear as a language copy. So, what happen If I want a language copy with a different name? How can I define a language copy with a different name without loosing the reference? I would like a site like this:

  • /es/es/comprar
  • /es/en/buy
  • /en/es/comprar
  • /en/en/buy
  • /language-masters/es/comprar
  • /language-masters/en/buy


AEM 6.5 Language copy SEO

Accepted Solutions (1)

Accepted Solutions (1)






you have to clearly distinguish between language copies and live copies, as these are 2 different concepts. Live copies are implemented by the MSM and you have the relationships between pages. Language copies are simple copies of the page, and there is not relationship between the "child" and the "parent" page; this relationships is just a very loose one based on the structure of the site trees and the name of the page; and of course it breaks if you start to modify the structure and/or the name of the pages.


With the MSM the situation is very different, because there each page knows the page it is inheriting from, and this information is preserved even if the child and/or parent page is renamed, moved, modified, etc. But of course that comes with a cost in terms of runtime performance and also administrative complexity and training for users. So it looks to me that you want to the use the MSM if you want to rename pages.




Answers (0)