I'm trying to determine the feasibility and effort for a client request. When a rendering is removed from a layout via the presentation details, they want all child renderings to also be removed to avoid having orphaned renderings in the layout. (ie. renderings in placeholders of the rendering being removed, recursively).

So, it seems feasible to look at a rendering, determine its placeholders and find renderings within those, and remove them as well.

A couple resources: here and here

However, what I can't figure out is when to initiate this. Is there a pipeline I am not seeing that fires when a rendering is removed?

Maybe I need to rethink the approach and remove orphaned renderings when an item is saved?

  • 1
    Wait, shouldn't this happen automatically in the Experience Editor? – Dmytro Shevchenko Jan 30 '17 at 22:59
  • 1
    Dmytro, yeah, you're right, in the EE when a rendering is removed the Final Layout has all the orphaned renderings cleaned up. I've updated the post. – Jason Booth Jan 30 '17 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.