Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Double Placeholder issue when including a component

ignacio_mancill
Level 2
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
Arun_Patidar
Community Advisor
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

Veena_Vikram
Community Advisor
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 ?