Expand my Community achievements bar.

Adding domain name as a prefix in the static scripts

Avatar

Level 1

We have a requirement to add a domain name as a prefix via the Apache Sling Resource Resolver Factory. I am adding a path /etc.clientlibs/Project/clientlibs/://Environment_Link//etc.clientlibs/Project/clientlibs but its not working.
Can anyone help me how to achieve this? Is there any alternative approach to achieve this?

Thanks

4 Replies

Avatar

Community Advisor

Hi @AishwaryaKhandelwal 

 

This can be done using the Externalizer service, please refer this documentation for details on how to achieve this - https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/dev...

 

Hope this helps!

 

Thanks

Narendra

Hi @DPrakashRaj ,

Currently the scripts are being shared as /etc.clientlibs/Project/clientlibs/://Environment_Link//etc.clientlibs/Project/clientlibs and working fine in all the environments. Some of the content is being shared to other CMS too and hence their is a need to add the domain name as a prefix so that the scripts gets loaded explicitly.

Avatar

Community Advisor

Domain name as prefix for all resource paths?

can you explain the use case as relative paths automatically get prefixed with domain name .

Avatar

Community Advisor

Hi @AishwaryaKhandelwal 

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.



Arun Patidar