Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Using Component Model data to show/hide fieldset in component Dialog

Avatar

Level 2

Hi guys so I have a task and I am not just looking for a solution, but hopefully the most efficient. So I have a component that needs to get data (boolean variable) for the page/template properties then using that, we can show/hide certain fields within the dialog.

 

So let's say in the template I am using I have a checkbox with a property that says include feature, now what I want is for a particular component, Say heading&summary to be able to grab that page property and use it to show/hide options on my Heading&Summary component.

 

How can I achieve this? I stumbled up a granite feature renderCondition and I am not sure if this is one of the case I can use, say maybe implementing "Simple" condition. 

 

You assistance would be appreciated. thanls

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hello,

. I wrote a tutorial on creating custom render conditions (can be done in 10 mins) here: https://levelup.gitconnected.com/aem-creating-custom-granite-render-conditions-28a21958f420. In the tutorial you will learn to show or hide a component property in the edit dialog based on the navigation title of the containing page (you can then quite easily change it to consider a different page property of your choosing).

Hope it helps 

View solution in original post

6 Replies

Avatar

Level 10
Hi, I decided to turn my answer into a tutorial. I sent it off for publication, should be ready in -+/ 24h

Avatar

Correct answer by
Level 10

Hello,

. I wrote a tutorial on creating custom render conditions (can be done in 10 mins) here: https://levelup.gitconnected.com/aem-creating-custom-granite-render-conditions-28a21958f420. In the tutorial you will learn to show or hide a component property in the edit dialog based on the navigation title of the containing page (you can then quite easily change it to consider a different page property of your choosing).

Hope it helps 

Avatar

Level 2
Thanks, sounds like what I am looking for, about to have a read so I will give an update ASAP

Avatar

Level 2
Best!! This is exactly what i wanted. Works beautifully and now at least going foward I can create my own custom rendor conditions.