How to remove "edit bar" of a component using code | Community
Skip to main content
Adobe Champion
November 19, 2015
Solved

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

  • November 19, 2015
  • 2 replies
  • 2559 views

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

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 kautuk_sahni

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

2 replies

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
November 26, 2015

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
dan_klco
Level 4
February 22, 2018

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/