AEM: Creating custom Granite render conditions | AEM Community Seeding

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K
kautuk_sahni
Community Manager

27-04-2020

BlogImage.jpg

AEM: Creating custom Granite render conditions by Theo Pendle

Abstract

How to create a custom, complex render condition using HTL and Java Sling Models instead of JSPs for AEM TouchUI

What is a Granite render condition?
โ€œRender conditionโ€ is a fairly self-explanatory term. More specifically, according to Granite documentation, it is โ€œa mechanic to indicate if the component should be rendered or notโ€.
So how does it work? You can find an example that youโ€™ll probably recognize if youโ€™ve ever used Assets (although there are hundreds of others): you cannot perform the same actions on an original asset as on a live copy.

The use case
Note: This use case was inspired by this question on the AEM Experience League forums. Thanks user neos45149736 for an interesting challenge ๐Ÿ‘

Here is what we want to do: create a component edit dialog which will render a certain field only if the component is on a page with a certain Navigation Title.

Note: for this tutorial I am using Editable templates.
I wonโ€™t go over how to create a template, Iโ€™ll assume you already have one.

Read Full Blog

AEM: Creating custom Granite render conditions

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager