Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Experience Fragment customized field need to disable

Avatar

Level 2

Hi,

I have overlay the experience fragment properties from this path(/libs/cq/experience-fragments/components/experiencefragment/cq:dialog/content/items/tabs/items/basic)  to our project structure and introduce the new customized checkbox field in basic tab. So the checkbox available while we creating the experience fragments and it's available for all the experience fragments templates.

Could you please suggest, how to disable this customized checkbox field to some other experience fragment templates?

6 Replies

Avatar

Community Advisor

Hi @vivianseba,

If you are not using main xfpage component as parent of the rest of templates then you can :

1.create one dialog in the child page component and add the field that you wanted to hide and

2. then add one property sling:hideResource = true.

this will hide that particular filed in the child dialog as in below image

 

hideResouce.png

If you are using one stand alone page component then you can simply skip the filed.

Hope this will help.

Umesh Thakur

Avatar

Employee Advisor

Hi @vivianseba 

 

I would suggest to use sling:resourceSuperType=cq/experience-fragments/components/xfpage on all the custom XF templates (page components) and introduce the new customized checkbox field under that specific template (xf page component). Considering the custom xf page components are created under /apps/<your project>/components structure.

 

Thanks

Avatar

Level 2
Thanks Shelly and The customized checkbox is available for the all the template while we creating the experience fragment ,But it should available for only with empty template.

Avatar

Level 2
Thanks Shelly and The customized checkbox is available for the all the template while we creating the experience fragment ,But it should available for only with empty template.Need suggestion

Avatar

Level 2
Thanks Shelly and the customized checkbox is available for the all the template while creation of the experience fragment ,But it should available for only with empty template. Need suggestion to disable the same for other template while creation of experience fragment

Avatar

Employee Advisor

@vivianseba

There are two nodes generated when a XF is created - [1]main XF node and under that [2]master variation node (other variations are added as well later). [1] has sling:resourceType always as cq/experience-fragments/components/experiencefragment while [2] has the sling:resourceType as cq/experience-fragments/components/xfpage or as per the template chosen.

I suggest you to add your custom field in the node [2] properties and not on node [1] by overlaying /libs/cq/experience-fragments/components/experiencefragment as it is same for all the XFs irrespective of the variation/ template chosen.

In case your requirement is specifically to add custom field in node [1] then you can leverage granite:renderCondition

https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui...

http://www.nateyolles.com/blog/2016/07/aem-granite-custom-render-conditions