Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 649
Jan Avatar asked Jan 19 '26 04:01

Jan


1 Answers

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'}" />
like image 112
Jan Avatar answered Jan 21 '26 21:01

Jan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!