dehaatbi
Returning Observer

Updating preview CaaS when navigation changes

Jump to solution

Hello,

some time ago we started to publish the navigation structure of our website into CaaS (v2). To achieve that we have created a page (+pageRef) called main_navigation, which just renders the navigation strucutre as json.

Now the problem: When an author adds or deletes a node from the structure the caas entity is not updated. To update the live caas we then have to trigger a caas generate (which is ok). For the preview caas we have to change something on the main_navigation page, because any change will trigger the update for the preview caas. This is not ideal, because the authors expect changes to be visible in the preview and they don't know that they have to change the main_navigation page as well.

Is there any way to listen for structure changes and trigger a script in that case? I am aware of a StoreListener class, but I have read here (https://community.crownpeak.com/t5/Questions-Answers/StoreListener-f%C3%BCr-elementChanged-Beispieli...) that it only works in the SiteArchitect on the client side. Since we currently use the Site Architect and the Content Creator we would need a server-side plugin. Is that somehow possible?

Best regards,

Tobi

 

0 Kudos
1 Solution

Accepted Solutions
Peter_Jodeleit
Crownpeak employee

You could use the IDProviderEventAgent from a service.

Peter

View solution in original post

0 Kudos
2 Replies
Peter_Jodeleit
Crownpeak employee

You could use the IDProviderEventAgent from a service.

Peter
0 Kudos

Hi Peter,

thank you, I think that was exactly what I was looking for. I also found some example code here which helped me: https://community.crownpeak.com/t5/Questions-Answers/Execute-script-on-save-button/m-p/41002

Instead of using a Service it makes probably more sense to use a ProjectApp, though.

Best regards,

Tobi

0 Kudos