Expand my Community achievements bar.

SOLVED

Page head contains client library reference to /libs/wcm/foundation/components/page/responsive

Avatar

Level 1

Hi everyone, 

 

First time poster here. I would greatly appreciate your input.

I have a client library reference which appears on several of my site's pages:

 

<html>
    <head>
        ...
        <link rel="stylesheet" href="/libs/wcm/foundation/components/page/responsive.css" type="text/css">
        ...
    </head>
    ...
</html>

 

The call to responsive.css is being blocked by the dispatcher because, per Adobe documentation, it is apparently bad practice to expose /libs/*

 

Going down the rabbit hole of page -> template -> template type -> component has led me to:

/libs/wcm/foundation/components/page/author.html line 22:

<sly data-sly-test="${wcmInit.templateCategories.length > 0}" data-sly-call="${clientLib.css @ categories=wcmInit.templateCategories}" />

It seems that templateCategories is non-zero, invoking a call to clientLib.css which eventually places the aforementioned reference on the page head.

 

My issue is not that responsive.css (category: wcm.foundation.components.page.responsive) is on the page, it is that the client library is not being proxied through /etc.clientlibs and is therefore inaccessible via the dispatcher.

 

Can anyone please point me in the right direction? This issue only appears on some environments, suggesting it is configuration-related.

 

Thanks in advance!

 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi @zeevd,

As @Shashi_Mulugu suggested, this clientlib is meant for authoring purposes and if authors are accessing AEM via Dispatcher then your Dispatcher should allow all paths (or you will have many other problems too).

However, if you wish to expose a clientlib under /libs in a Publisher witha  Dispatcher that prevents access to /libs, then the clientlib must have allowProxy="{Boolean}true" set on it. This will cause AEM to fetch it under /etc.clientlibs rather than /libs 

View solution in original post

3 Replies

Avatar

Community Advisor

@zeevd Thank you for posting your query in Communities. Can you please confirm if the AEM instance you are seeing this issue is in Author or Publisher?

 

In general via template, author.html file will be included in author side to support editing capabilities and this file should not be loaded on publisher. 

 

So if author, make sure you have to allow everything via dispatcher including/libs/..

 

If in publishers, make sure you not include author.html.

Avatar

Correct answer by
Level 10

Hi @zeevd,

As @Shashi_Mulugu suggested, this clientlib is meant for authoring purposes and if authors are accessing AEM via Dispatcher then your Dispatcher should allow all paths (or you will have many other problems too).

However, if you wish to expose a clientlib under /libs in a Publisher witha  Dispatcher that prevents access to /libs, then the clientlib must have allowProxy="{Boolean}true" set on it. This will cause AEM to fetch it under /etc.clientlibs rather than /libs 

Avatar

Level 1
Thanks Theo and Shashi for your prompt responses. I should have clarified that my question pertains to PUBLISH instances (authors are not accessed through the dispatcher). Adding allowProxy=true to the client library under "/libs/wcm/foundation/components/page/responsive" causes the client lib to be surfaced via /etc.clientlibs and pass through the dispatcher. This does not, however, solve the issue of author.html being referenced on the publisher. The inclusion of author.html does not seem to be conditional. If you take a look at "/libs/wcm/foundation/components/page/head.html" you will see a line <sly data-sly-include="author.html" /> What am I missing here? Is there an author-specific WCM page component?