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

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

AEM Component Placeholders the WCM Core Component Way

Avatar

Level 7

Hi team,

 

Here my code is like below,

line number 1

<!-- Here I cant get a value to isEmpty variable without starting a loop it in this line cas all the fields are inside a multifield. Also if I start a loop from this line it is not the output I want. Simply I don't want to loop it from here-->

<sly data-sly-test.isEmpty="${!proprty_value}"> // property_value should be a mandatory property one 

<sly data-sly-use.templates="core/wcm/components/commons/v1/templates.html"/>

<sly data-sly-call="${templates.placeholder @ isEmpty = isEmpty}"></sly>

 

<sly data-sly-test="${!isEmpty}">

//rendering html has been put here. So when mandatory property has a value only rendering html will be execute otherwise placeholder will be appeared.  

line number 25

</sly>

 

Problem is I have a component where all the properties are inside a multifield and I can't assign a value to isEmpty field without starting a loop from the top of the html. If I starts a loop from top that's not the output I want. I want to loop the code from the 25th of line only. But then I can't get a value to isEmpty field from multifield properties .

 

Any suggestions highly appreciated 

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

Do you still want to read the multifield list and check to see if the list is empty and show the placeholder text?

 

<div data-sly-test="${!property_value}">List is empty, show the placeholder text</div>

 assuming property_value is multifield value.

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Community Advisor

Do you still want to read the multifield list and check to see if the list is empty and show the placeholder text?

 

<div data-sly-test="${!property_value}">List is empty, show the placeholder text</div>

 assuming property_value is multifield value.