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
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?
Solved! Go to Solution.
Views
Replies
Total Likes
@puniths34934369 I would recommend creating an Issue in https://github.com/adobe/aem-core-wcm-components/issues.
Views
Replies
Total Likes
@puniths34934369 I would recommend creating an Issue in https://github.com/adobe/aem-core-wcm-components/issues.
Views
Replies
Total Likes
Hello, I have the same problem. Did you figure it out?
Did anyone figure out the problem?
we were forced to write our own logic without using core components
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?
Should i use the com.adobe.aem.wcm.seo package for java implementation or java.util.Locale itself is enough
Can you please tell what has to be coded in alternateLanguageLinks method. I have imported the locale utility.
Thank you so much for your response Arthur. can u tell what has to be coded in PageTreeSitemapGeneratorImpl.
Anywhere else the changes needs to be done other than these 2 codes to make it work?
this method is written in PageTreeSitemapGeneratorImpl. From what I can add, the name of the property is:
But that's just the name of the property, which can be chosen to be anything while creating page property.
That's it, I think.
rel="alternate" hreflang="${item.key.toLanguageTag}" href="${item.value}">
in this line what value will "item" hold?
It is the element from map that is the result of the method I sent above.
Hi Arthur,
With what value the variable "page" has to be initialized
Thanks Arthur for the help. one more help. what has to be written inside the alternateLanguageLinksModel template?
Hi Arthur
I have implemented this hreflang code but the issue is, it is only returning links which are written in English and neglecting the links written in other languages. Example spanish, chinese, japanese etc.Is there any solution for this. Kindly help! Thanks.
And did you put these links in the page property?
Was the problem sorted out?
To enable the alternate language links from Core components, you need to check the Render alternate language links field on the template Page Policy.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies