Adding domain name as a prefix in the static scripts | Adobe Higher Education
Skip to main content
April 3, 2024

Adding domain name as a prefix in the static scripts

  • April 3, 2024
  • 3 reacties
  • 862 Bekeken

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

Er kunnen geen reacties meer worden geplaatst op dit onderwerp.

3 reacties

narendragandhi
Community Advisor
Community Advisor
April 3, 2024

Hi @aishwaryakh1 

 

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/developer-tools/externalizer

 

Hope this helps!

 

Thanks

Narendra

April 4, 2024

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.

DPrakashRaj
Community Advisor
Community Advisor
April 3, 2024

Domain name as prefix for all resource paths?

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

arunpatidar
Community Advisor
Community Advisor
April 8, 2024

Hi @aishwaryakh1 

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