Expand my Community achievements bar.

SOLVED

Need help in understanding resource resolver factory config for SPA pags

Avatar

Level 2

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
 
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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... 

EstebanBustamante_0-1723136142376.png

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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... 

EstebanBustamante_0-1723136142376.png

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