Categories
AEM Java Programming Web Development

AEM Sightly’s nightmare

sightly-logo

I’ve been working on Sightly templates which they are calling HTL (HTML Template Language). I’ve discovered some hacks/techniques on how to manipulate variables. So, I thought I’m already used to it.

I have worked on one component which I duplicated from my working component. I know it is going to work but actually something happened. I didn’t know why it is happening that frustrates me.

The data-sly-list is showing my the list keys instead of values. I kept changing my Java Use-API to think that something is wrong with my collection.

Actually nothing is wrong with my implementation. It was actually because of the double quotes (“”) that my editor is doing. Every time I write double quote it closes it with another one. If you are rushing, you will not be able to notice this in your HTML codes.

<!-- The double quote below will give you problem -->
<div class="class-name"">
    <p>Some text here</p>
</div>

<!--/* This code will always print your list keys */-->
<!--/* Instead of giving you the list and loop it as normal */-->
<sly data-sly-list="${javaUseAPI.listItems}">
    ${itemList.index}
</sly>

I’m using Visual Studio Code as my editor. They have added auto-completion for quotes on their latest updates. To disable it, you need to do the settings below.

{
     "editor.autoClosingBrackets": false
}

I know auto-completion in your code helps developer a lot. It just happened that it caused me some trouble and frustrate me a little bit. It is a good thing to remember that not all auto-completion are helpful. Sometimes it has some disadvantages and we need to take note of it.

Categories
AEM Java Programming

Adobe Experience Manager (AEM)

I’ve been working on Adobe Experience Manager (AEM) previously known as Communique5 (CQ5) for quite a while now. At first when I started learning it, I thought it is going to be difficult for me to understand it but I was wrong. This enterprise CMS is awesome and has so many things that you can do.

I have used two versions of it which are CQ5 and AEM6. There are huge difference in terms of data management, user management, security, etc. But for me, the whole experience were somehow the same. I haven’t fully understand the whole updates actually. 🙂

From traditional JSP and JSTL development, AEM introduced their own templating engine called Sightly. Although you cannot just drop both JSP and JSTL development as you might still need it for some of your work, Sightly on the other hand produced shorter and cleaner coding. It is also suitable to developers who uses only HTML/JS/CSS and doesn’t know much on doing Java/JSP/JSTL. I’ve been using it with Java Use-API.

This is just a start of my experience with this incredible web CMS. I hope you guys will keep in touch with me and don’t hesitate to ask me things. I’ll find ways to help you.