Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

neos45149736
Level 2
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
Theo_Pendle
Correct answer by
Community Advisor
Community Advisor

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
Theo_Pendle
Community Advisor
Community Advisor
Hi, I decided to turn my answer into a tutorial. I sent it off for publication, should be ready in -+/ 24h 🙂
Theo_Pendle
Correct answer by
Community Advisor
Community Advisor

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

neos45149736
Level 2
Level 2
Thanks, sounds like what I am looking for, about to have a read so I will give an update ASAP
neos45149736
Level 2
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.