AEM Sightly Absolute path for Client libs

Avatar

Avatar

ChristophGMlr

Avatar

ChristophGMlr

ChristophGMlr

11-07-2017

So this is a newbie question I'm sure... But I have the following code:

<sly data-sly-call="${clientLib.css @ categories='ceportal'}"></sly>

Which is rendered as :

<link rel="stylesheet" href="https://forums.adobe.com/etc/designs/ceportal/clientlibs.css" type="text/css">

I need it to be rendered as:

<link rel="stylesheet" href="Https://Some.Url.Com/etc/designs/ceportal/clientlibs.css" type="text/css">

Any advice experts?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Feike_Visser1

Employee

Avatar

Feike_Visser1

Employee

Feike_Visser1
Employee

11-07-2017

The Sightly/HTL clientlibs will always output a relative path. With rewriters you can output different urls.

Answers (2)

Answers (2)

Avatar

Avatar

NitinHarikant

Avatar

NitinHarikant

NitinHarikant

11-07-2017

Assuming Https://Some.Url.Com is of different domain, you can directly add the following line in you sightly code.

<link rel="stylesheet" href="Https://Some.Url.Com/etc/designs/ceportal/clientlibs.css" type="text/css">

Avatar

Avatar

ChristophGMlr

Avatar

ChristophGMlr

ChristophGMlr

11-07-2017

So it's not a different domain, the problem is this page in particular is read via another URL so when it is read on another domain the styles get lost.