AEM - Sightly Elements
In the earlier blogs, we have seen when use data-sly-test using a div tag, div tag is also displayed in the html content. To avoid unnecessary wrappers around the actual HTML content, we can directly use the required HTML markup or use the sly element directly. For Example: <div data-sly-test.pageLinkReference="${properties.cq:pageLinkRef}"> <a href="${pageLinkReference}">${page.title}</a> </div> Output: (We can see the additional div tag around the anchor elements. <div> <a href="/content/sampleproject/fr.html">This text is populated from the component</a> </div> To remove the additional div use the below example with sly elements <sly data-sly-test.pageLinkReference="${properties.cq:pageLinkRef}"> <a href="${pageLinkReference}">${page.title}</a> </sly> ...