Expand my Community achievements bar.

SOLVED

Override Content Fragment List Core Component Dialog

Avatar

Level 2

Currently the content fragment list core component is showing all the available content fragment models in its dialog dropdown for model. I need to override the model dropdown in content fragment list dialog and show only the content fragment models specific to a project/path. Any suggestion please on how can we implement this

Koustuva1_0-1656600213288.png

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Koustuva1 ,  

By default, all content fragments of the model defined as Model Path are included in the list. So you only have one option to override it.

But, You can override like this.

 

  • Write your own servlet with resourceType <yourproject>/contentfragmentlist
  • Create a ContentFragmentList component in your project, write cq:dialog with model node  Datasource pointing to above resourceType.
  • your Servlet will be just like this except at line 89 modify code like this, 

                  parameterMap.put("path", "/conf/<yourproject>")

 

 

Hope this will help,

~Aditya.

Thanks,

Aditya Chabuku

View solution in original post

3 Replies

Avatar

Community Advisor

1. Override the node https://github.com/adobe/aem-core-wcm-components/blob/eee7007cfb2ff03a2cb9374709dd1caab943c12b/conte... in prox component to cahnge the sling:resourecType of datasource node

2. Create your own datasource resource type e.g. https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w... 



Arun Patidar

Avatar

Correct answer by
Community Advisor

Hi @Koustuva1 ,  

By default, all content fragments of the model defined as Model Path are included in the list. So you only have one option to override it.

But, You can override like this.

 

  • Write your own servlet with resourceType <yourproject>/contentfragmentlist
  • Create a ContentFragmentList component in your project, write cq:dialog with model node  Datasource pointing to above resourceType.
  • your Servlet will be just like this except at line 89 modify code like this, 

                  parameterMap.put("path", "/conf/<yourproject>")

 

 

Hope this will help,

~Aditya.

Thanks,

Aditya Chabuku

Avatar

Level 2

Thank You  @arunpatidar and @Aditya_Chabuku

If we want to add both resourceType and Path as dynamically picked values will it be possible to handle.