Recently I got the opportunity to explore AEM render condition and being AEM developer I really enjoyed this feature.
I have explored AEM render condition with built-in rendercondition and Custom rendercondition both.
I will talk about both with built-in rendercondition and Custom rendercondition with one simple use case here.
Let’s consider I have one component named: Add Color in Your Title and it’s dialog editor fields has been shown below -
A colorfield and a textfield are part of this Touch UI dialog
Now I want to make this colorfield available only for ‘en’ language code along with textfield and for others like de, fr authors will be seeing only textfield.
We can achieve this via AEM render condition here.
Here we could see I have created granite:rendercondition (nt:unstrurtured) and used granite/ui/components/coral/foundation/renderconditions/simple and this takes the decision using expression property.
In expression property I have clearly defined Header Referer should contain ‘en’ and then only display/render colorfield for authors.