Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

generate hreflang in nextjs spa aem integration

Avatar

Level 1

Hi, firstly i let you know that i'm new to AEM ecosystem so i haven't already explored all the possibility AEM can offer.

I'm currently on a projet that use AEM SPA in an NextJS environnement my pages are rendered using @adobe/aem-react-editable-components on nextjs SSR, using fetchModel that get all my page component models (i think its the way it should work).

 

Everything work well i can access my pages and view all my components this is great ! but now what i need to do for the SEO is to render hreflang tags in my page head, using nextjs i can easely add some tag the head for this purpose but now what i need to do is to get the current page loaded on NextJS SSR translated varients. How can i achieve that ? 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@emilux if all your locale pages also managed in AEM via MSM... then in your page model json.. you should pass hreflang and it's related locale urls.. and then you should read these values in your react/next js app.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@emilux if all your locale pages also managed in AEM via MSM... then in your page model json.. you should pass hreflang and it's related locale urls.. and then you should read these values in your react/next js app.

Avatar

Administrator

@emilux Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni