Issue with wcm/msm/components/ghost | Community
Skip to main content
Shashi_Mulugu
Community Advisor
Community Advisor
July 20, 2020
Solved

Issue with wcm/msm/components/ghost

  • July 20, 2020
  • 1 reply
  • 3212 views

Hello Team,

 

I read through all other community posts and internet before coming.

 

I have an MSM with master pages setup. While i have created live copy pages and deleted the one of the child item in a container by breaking the inheritance, i am getting my current component converted to "wcm/msm/components/ghost". That is fine as it will help us in re-enabling the inheritance but due that it is causing problem in Publisher as well since it is getting extra <div class="ghost <my-comp-name>"></div> since by default all childs under the layout container are getting pulled..

 

<div class="ghost <my-comp-name>"></div>

 

<sly data-sly-use.container="com.adobe.cq.wcm.core.components.models.LayoutContainer" data-sly-repeat="${container.items}" data-sly-resource="${item.path @ decoration=true, cssClassName='my-comp-name'}"></sly>

 

@kautuk_sahni Please help

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijayalakshmi_S

Hi @shashi_mulugu,

As you said, MSM ghost node is needed in author for re-enabling inheritance in future. 

In publish, as you are listing the resource items from LayoutContainer, you can write a custom implementation of LayoutContainer using below actual implementation as sample. (mapping it to your component resourceType in @Model annotation)

https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/LayoutContainerImpl.java

In readItems() method, return the resource list except the ghost resource on conditional basis. 

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
July 20, 2020

Hi @shashi_mulugu,

As you said, MSM ghost node is needed in author for re-enabling inheritance in future. 

In publish, as you are listing the resource items from LayoutContainer, you can write a custom implementation of LayoutContainer using below actual implementation as sample. (mapping it to your component resourceType in @Model annotation)

https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/LayoutContainerImpl.java

In readItems() method, return the resource list except the ghost resource on conditional basis. 

Shashi_Mulugu
Community Advisor
Community Advisor
July 20, 2020
Yep looks like that is the only option. Not sure why cannot it be OOTB core 🙂