AEM 6.5.10 - Core Components alternate language inside the head meta not working | Community
Skip to main content
Level 2
March 2, 2022
Solved

AEM 6.5.10 - Core Components alternate language inside the head meta not working

  • March 2, 2022
  • 3 replies
  • 5813 views

Currently using AEM Core components v2.18.0

I am trying to leverage the OOTB functionality for generating the Alternate Languages for page meta tags. I see the OOTB code under /apps/core/wcm/components/page/v2/page/head.links.html

Below is the piece of code which is responsible for generating it.

<link data-sly-test="${page.alternateLanguageLinks}"
data-sly-repeat="${page.alternateLanguageLinks.entrySet}"
rel="alternate" hreflang="${item.key.toLanguageTag}" href="${item.value}">

Below is my page structure

/content/<my-site>/en/<child-pages>

/content/<my-site>/ja/<child-pages>

/content/<my-site>/zh/<child-pages>

.

.

etc

 

But the above piece of code always generates empty.

 

Also i found the implementation of the code in Github

https://github.com/adobe/aem-core-wcm-components/blob/a7e377c6810dd2125a902d3ef3df5c92ec2a1719/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v2/PageImpl.java

 

 

Can someone please explain what is com.adobe.aem.wcm.seo.SeoTags; and how to get the above code working. Am i missing some configration?

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 kautuk_sahni

@puniths34934369 I would recommend creating an Issue in https://github.com/adobe/aem-core-wcm-components/issues.

 

 

3 replies

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
March 23, 2022

@puniths34934369 I would recommend creating an Issue in https://github.com/adobe/aem-core-wcm-components/issues.

 

 

Kautuk Sahni
Level 2
November 10, 2022

Hello, I have the same problem. Did you figure it out?

Level 2
August 30, 2023

Did anyone figure out the problem?

Level 2
August 30, 2023

Can you help me to implement hreflang. this is the exact functionality i'm looking for. OOTB code given in adobe github is not returning any value.

Should i use sitemap or the code itself is enough.

is com.adobe.aem.wcm.seo package needed to implement it?

 


we were using toLanguageTag() from java.util.Locale. Does it work for you?

Level 2
August 30, 2023

Was the problem sorted out?

June 5, 2024

To enable the alternate language links from Core components, you need to check the Render alternate language links field on the template Page Policy.