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
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM MSM - Retrieve Language Copy by API

Avatar

Avatar
Boost 5
Level 2
alex_p_c_
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Give Back 5
Give Back 3
Ignite 3
View profile

Avatar
Boost 5
Level 2
alex_p_c_
Level 2

Likes

8 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Give Back 5
Give Back 3
Ignite 3
View profile
alex_p_c_
Level 2

20-05-2020

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

Thanks!

AEM 6.5 Language copy SEO

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

21-05-2020

Hi,

 

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.

 

HTH,

Jörg

Answers (0)