Expand my Community achievements bar.

SOLVED

Issue with wcm/msm/components/ghost

Avatar

Community Advisor

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

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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...

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

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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...

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

Avatar

Community Advisor
Yep looks like that is the only option. Not sure why cannot it be OOTB core