Need help in understanding resource resolver factory config for SPA pags | Community
Skip to main content
Level 2
August 8, 2024
Solved

Need help in understanding resource resolver factory config for SPA pags

  • August 8, 2024
  • 1 reply
  • 636 views

for slightly pages

 

<a href="/content/brand/us/en/test.html"></a>

will be rewritten as 

<a href="/test.html"></a>

by using below rule in resource resolver factory config / mappings

"^/content/brand/us/en/(.+)\\.html</$1"
 
For SPA pages , 
resource resolver factory config / mappings transformation is not working ? is that expected ?
 
In SPA , we just pass CTA links as "/content/brand/us/en/test.html" or "/content/brand/us/en/test" in json to front end react
and it is rendering final links as <a href="/content/brand/us/en/test.html"></a> in SPA pages
 
Need help in handling this issue. 
I want SPA links to show as <a href="/test.html"></a> in final render
 
Should i handle it using string manipulations while sending CTA in json 
or 
It should be handled in react code to truncate the prefix ?
 
Or is there anything similar to resource resolver factory config / mappings that will transform URLs in SPA
 
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 EstebanBustamante

Hi, 

I think this is expected, the reason why you are seeing the desired render in the HTML is because of the "Day CQ Link Checker Transformer" uses the map() function as explained here: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/overview/seo-and-url-management#etc-map 

But the "linkTransformer" is not being used as part of the SPA editor, but there might be a "workaround" described in the following thread. Please check it out: https://github.com/adobe/aem-spa-project-archetype/issues/86#issuecomment-501672052. If this doesn’t work for your use case, I think you might have to do some string manipulation.


Hope this helps

 

1 reply

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
August 8, 2024

Hi, 

I think this is expected, the reason why you are seeing the desired render in the HTML is because of the "Day CQ Link Checker Transformer" uses the map() function as explained here: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/overview/seo-and-url-management#etc-map 

But the "linkTransformer" is not being used as part of the SPA editor, but there might be a "workaround" described in the following thread. Please check it out: https://github.com/adobe/aem-spa-project-archetype/issues/86#issuecomment-501672052. If this doesn’t work for your use case, I think you might have to do some string manipulation.


Hope this helps

 

Esteban Bustamante