Jan
Jan

Reputation: 81

AEM / CQ page components not refreshing / updating after add,edit,remove

I ran into a problem, where components on a page would not refresh even though I defined EditListenersConfig in the edit_config file. No Errors in the server's console nor in the webbrowser. I guess some kind of clientlibs are not loaded but I can't find any solution besides everyone telling me to configure editListeners. The strangest part about that is, on other pages on the same server it works fine.

Upvotes: 3

Views: 1808

Answers (1)

Jan
Jan

Reputation: 81

Turns out I did missed some client libraries in my page. So if anyone has the same issue add the following lines to your customheaderlibs.html in your page component:

<sly data-sly-use.wcmInit="/libs/wcm/foundation/components/page/initwcm.js"
     data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html">
  <sly data-sly-call="${clientlib.css @ categories='aem-demo-bundle.main,aem-demo-bundle.dependencies'}"/>
  <sly data-sly-test.templateCategories="${wcmInit.templateCategories}"
       data-sly-call="${clientLib.css @ categories=templateCategories}" />
</sly>

<sly data-sly-include="author.html" />

And create a file called author.html in the same folder and add following. code:

<sly
     data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}"
 data-sly-call="${clientLib.all @ categories='cq.authoring.page'}" />
<sly  data-sly-call="${clientLib.all @ categories='cq.wcm.edit'}" />

<sly data-sly-test="${!wcmmode.disabled}" data-sly-call="${clientLib.all @ categories='cq.wcm.foundation-main'}" />
<sly data-sly-test="${!wcmmode.disabled}" data-sly-call="${clientLib.all @ categories='cq.shared'}" />

Upvotes: 3

Related Questions