CancelInheritance for child pages | Community
Skip to main content
Level 2
February 5, 2025
Solved

CancelInheritance for child pages

  • February 5, 2025
  • 3 replies
  • 713 views

Hi all,

We got a requirement to  run workflow on parent page to cancel inheritance for child pages of a parent page the inheritance should cancel for child page properties and child page components what's the best way to do this,

 do we need to iterate through all child pages and then iterate through components of page and do cancelinheritance

was there any other way to acheive this.

Thanks in advance

3 replies

AmitVishwakarma
Community Advisor
Community Advisor
February 5, 2025

Use the LiveRelationshipManager API in AEM to:
1. Retrieve live copies (child pages) of the parent or blueprint page.
2. Use the cancelRelationship() method to break inheritance for each child page.

This approach eliminates the need for manual iteration through child pages and components.

Ns334Author
Level 2
February 5, 2025

Thank you.

ManviSharma
Adobe Employee
Adobe Employee
February 9, 2025

Hi Team,

 

1. Iterate Through Child Pages and Components

  • You would start by identifying the parent page and retrieving all its child pages programmatically.
  • For each child page:
    • Cancel inheritance for the page properties using the LiveRelationshipManager API.
    • Iterate through the components of each child page and cancel inheritance for individual components.

This approach ensures granular control over the inheritance-breaking process for both page properties and components.

Example Workflow:

  • Create a custom workflow that:
    • Accepts the parent page as input.
    • Uses the PageManager to fetch child pages.
    • Iterates through the child pages and their components to cancel inheritance.