Expand my Community achievements bar.

SOLVED

Ghost nodes in MSM

Avatar

Level 2

The ghost nodes that get created while cancelling inheritance have div wrapped and create unnecessary space on the page. How can this be handled , avoid the space from coming in the publisher without any code changes to the container etc. Do we have any hotfix or configurations to avoid the issues that ghost node causes?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

 

AEM creates a placeholder or "ghost" node for the component in the child page.

Did you try CSS style - apply display 'none' .

Generally these type will handle in CSS style classes. 

or need to create a custom component to handle this scenario - Create a custom component that doesn't output any markup when it doesn't have any content. You could then use this component as a wrapper for the components where you're cancelling inheritance.

or other way is post processing with sling filter

Implement a post-processing step that removes the empty divs from the HTML before it's sent to the browser. This could be done using a filter in the Sling processing pipeline.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

 

AEM creates a placeholder or "ghost" node for the component in the child page.

Did you try CSS style - apply display 'none' .

Generally these type will handle in CSS style classes. 

or need to create a custom component to handle this scenario - Create a custom component that doesn't output any markup when it doesn't have any content. You could then use this component as a wrapper for the components where you're cancelling inheritance.

or other way is post processing with sling filter

Implement a post-processing step that removes the empty divs from the HTML before it's sent to the browser. This could be done using a filter in the Sling processing pipeline.

Avatar

Level 2

Thank you @SureshDhulipudi . I guess all the solutions would work and the fastest would be the CSS/JS. I can get all the elements with class-ghost and hide them on page load.