내 커뮤니티 업적 표시줄을 확대합니다.

해결됨

My OOTB component changes are showing in component.model.json but not in page.model.json

Avatar

Level 1

 

I have a navigation component which is core component. I've extended it by adding one pathfield for displaying logo. The logo changes are showing in navigation component's model.json but the changes are not in hompage's model.json


public interface ProfileModel extends Navigation {

public String getNavigationRoot();
public String getStructureStart();
public String getCollectAllPages();
public String getStructureDepth();
public String getDisableShadowing();
public String getId();
public String getEditLogo();

public String getArrowLogo();
}

public class ProfileModelImpl implements ProfileModel {
@ValueMapValue
private String navigationRoot;

@ValueMapValue
private String structureStart;

@ValueMapValue
private String collectAllPages;

@ValueMapValue
private String structureDepth;

@ValueMapValue
private String disableShadowing;

@ValueMapValue
private String id;

@ValueMapValue
private String editLogo;

@ValueMapValue
private String arrowLogo;

static final String RESOURCE_TYPE = "part/components/profile";


public String getNavigationRoot() {
return navigationRoot;
}

public String getStructureStart() {
return structureStart;
}

public String getCollectAllPages() {
return collectAllPages;
}

public String getStructureDepth() {
return structureDepth;
}

public String getDisableShadowing() {
return disableShadowing;
}

public String getId() {
return id;
}

public String getEditLogo() {
return editLogo;
}

public String getArrowLogo() {
return arrowLogo;
}

 

}

 

Im not able to see editLogo or arrowLogo in the json

 

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

Hi @baalaajira 

 

You need to use ComponentExporter as well in your model impl class. You can refer below document on how to extend core component, the right way

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/s...

 

Hope it helps!
Let me know

원본 게시물의 솔루션 보기

2 답변 개

Avatar

Community Advisor

@baalaajira Can you also post your annotations? You need to use componentexporter to your annotation to get the changes in page.model.json.

https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w...

Avatar

정확한 답변 작성자:
Community Advisor

Hi @baalaajira 

 

You need to use ComponentExporter as well in your model impl class. You can refer below document on how to extend core component, the right way

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/s...

 

Hope it helps!
Let me know