Understanding `data-sly-attribute` in AEM Sightly (HTL)
The data-sly-attribute directive in HTL (HTML Template Language) allows developers to dynamically set one or more attributes on an HTML element. This powerful feature provides flexibility in managing HTML attributes based on the logic defined in your Sling models or Use classes. Quick Links 1. Element and Attribute Visibility 2. Attribute Value Options 3. Attribute […]
AEM Sightly Official Documentation: Everything You Need to Know
This blog particularly promotes Adobe’s AEM Sightly documentation, which lives inside of their github repository. In this article, we’ll explore the significance of AEM Sightly and how its official documentation can be a valuable resource for developers working with Adobe Experience Manager. With understanding Adobe’s Sightly documentation, you will be equipped with the right tools […]
AEM RichText Remove P Tag on Sightly
You may have been trying to search the internet for an out of box solution to remove the single paragraph container for Touch UI, and have found something like removeSingleParagraphContainer. But however, this attribute was for the Classic UI and deprecated. From my knowledge, there isn’t anything out of the box that can remove the […]
AEM Sightly Component(s) Empty CQ PlaceHolder
In almost all cases, component’s that are not configured, dragged onto the page should have some sort of indicator telling content authors that they should configure the component; a few of us calls this the empty component placeholder or “cq-placeholder”. A novice AEM full-stack may not be geared with the right tools, and so they […]
Create System | Service Users in AEM 6.5 with Code Configurations
In this article we will walk through how to configure your AEM project to have the AEM environment self configure System Users in AEM with code, so that you would not need to do it the manual way. With the leverage of the org.apache.sling.jcr.api v2.4.0 bundle provided by AEM 6.5.4+ or AEM as a Cloud […]
AEM Sightly Comments with Examples
When writing comments in your Sightly HTL file, it’s best practice not to use HTML comments, but to use the sightly, HTML Template Language. 1. HTL comments are not evaluated and returned back as an empty string in the server-side rendered results. This is best practice when developers are including some comments for other developers […]
Granite UI Multifield Sightly Traverse | Iterate Simple Example
In this article, we will share an example on on how we can iterate and traverse through multifield nodes that have been generated by the Touch UI using Sightly in a very simple way. Going through this article, we will be setting up multifield Granite UI links (as if we are building a menu navigation). […]
HTL Java Use-API Code Example
The HTML Template Language (HTL) Java Use-API allows an HTL file to use data-sly-use to access helper functions in a custom Java class. This allows any sophisticated business logic to be wrapped in Java code, while the HTL code is just responsible for direct markup generation. A simple POJO can be used as a Java […]
How to Generate Unique AEM Component ID with Confidence
You frequently require a special ID for the AEM component. Either a backend server-side call or a custom JS action trigger are required. If the component is dragged and placed on the page more than once, the hard-coded field ID is not guaranteed to be unique. When considering ID, you might consider directly using the […]