Override Content Fragment List Core Component Dialog | Community
Skip to main content
Level 2
June 30, 2022
Solved

Override Content Fragment List Core Component Dialog

  • June 30, 2022
  • 2 replies
  • 1000 views

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

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Aditya_Chabuku

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.

2 replies

Aditya_Chabuku
Community Advisor
Aditya_ChabukuCommunity AdvisorAccepted solution
Community Advisor
June 30, 2022

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
Koustuva1Author
Level 2
August 2, 2022

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.