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
Do you knoiw if this is actually an issue or there is an approach on how to resolve this?
Regards.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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 ?
Views
Replies
Total Likes