Expand my Community achievements bar.

SOLVED

How to remove "edit bar" of a component using code

Avatar

Adobe Champion

I had a requirement in which I needed to hide "edit bar" in authoring mode based on some condition .

I am using this code snippet "componentContext.setDecorate(Boolean.FALSE)"  .

 

Issue caused is sometimes it is removing "edit bar" always in authoring mode apart from that condition also . Anyone faced this situation before and what may be other best practices to handle show/hide of editbar on basis of some condition .

Regards

1 Accepted Solution

Avatar

Correct answer by
Administrator

HI 

Please refer to the article :-

Link:- http://labs.6dglobal.com/blog/2014-01-08/the-great-and-powerful-cq-editconfig/

Here you can use 

"cq:EditConfig" allows you for configuring many important features of the component's editing experience including:

  • Dialog display behavior
  • Edit bar or hover appearance
  • Editor items
  • Listeners
  • Advanced features such as:
    • Drop targets
    • Additional actions
    • InPlace editing

Changing cq:layout  to rollover from editbar, your work would be done.

Write an OSGi service, and call it to toggle JCR node's value.

or Reading JCR nodes, please have a look at any of these options:-

Link:- https://helpx.adobe.com/experience-manager/using/jqom.html

Link:- https://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html (Query Builder)

Link:- https://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html (JCR API)

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

2 Replies

Avatar

Correct answer by
Administrator

HI 

Please refer to the article :-

Link:- http://labs.6dglobal.com/blog/2014-01-08/the-great-and-powerful-cq-editconfig/

Here you can use 

"cq:EditConfig" allows you for configuring many important features of the component's editing experience including:

  • Dialog display behavior
  • Edit bar or hover appearance
  • Editor items
  • Listeners
  • Advanced features such as:
    • Drop targets
    • Additional actions
    • InPlace editing

Changing cq:layout  to rollover from editbar, your work would be done.

Write an OSGi service, and call it to toggle JCR node's value.

or Reading JCR nodes, please have a look at any of these options:-

Link:- https://helpx.adobe.com/experience-manager/using/jqom.html

Link:- https://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html (Query Builder)

Link:- https://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html (JCR API)

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 5

FYI - since labs.6dglobal.com is down, here's a link to the same article on the cq:editconfig on my personal blog:

https://www.danklco.com/posts/2014/01/08/the-great-and-powerful-cq-editconfig/