Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Double Placeholder issue when including a component

Avatar

Level 2

I have included a component inside another one with data-sly-resource and when included component is empty it shows two placeholders, the component placeholder and it also is taking the parent placeholder.

This is where component is being injected

<div>

<a href="${properties.url}">${properties.url}</a>

<span data-sly-resource="${'beforetitle' @ resourceType='project-test/components/content/title'}"></span>

</div>

This is the injected component

<div class="test-class"

     data-sly-use.title="com.adobe.cq.wcm.core.components.models.Title"

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

     data-sly-test.text="${properties.jcr:title}">

    <h1 class="test-class__text" data-sly-element="${title.type}">${text}</h1>

</div>

<sly data-sly-call="${template.placeholder @ isEmpty=!text, classAppend='test-class'}"></sly>

when you put the button component in a responsive grid or parsys the properties.jcr:title is null and it shows the placeholder but is taking the parent component as shown here below

1541019_pastedImage_1.png

Do you knoiw if this is actually an issue or there is an approach on how to resolve this?

Regards.

2 Replies

Avatar

Community Advisor

Hi,

why did you created title.html for project-test/components/content/title?

if you need to create title component, create a proxy component e.g. project-test/components/content/title using core components.

Using Core Components



Arun Patidar

Avatar

Community Advisor

What is your exact requirement ? Are you trying to bring a title and link ? Can't you have single component with all your authoring fields ?