[Theme] How to detect edit mode when using new in-place editor


I have developed a custom Confluence theme, which renders a specific header for the page mode view and another specific header for edit (and edit-preview). Before Confluence 5.9, a click on edit called editpage.action, which set the mode to edit in the page decorator page.vmd, based on this variable I could render the different headers within my custom decorators.

Since Confluence 5.9 a click on edit, does not call editpage.action anymore, instead it calls /rest/tinymce/1/content/.json and despite I am in edit mode now, the mode variable in page.vmd is still view, hence my header is also still the one for the view mode. I suppose this is, because the editor is now loaded via XHR.

I really want to use the new editor and its in-place editing feature, but I still need to render different headers for view and edit mode. Does anyone know, how to achieve this in Confluence 5.9 and above?


I have same question for different use case. Would love to know if you figured it out. We embed a Jira issue collector via Confluence admin “Custom HTML” so our users can easily ask for help and we can easily track everything. Works great in read-mode, but when editing the issue collector covers the scroll bar (https://jira.atlassian.com/browse/JRASERVER-31829). Looks like Atlassian isn’t fixing the issue collector problem any time soon, so I thought I’d hack around it by wrapping the call to only show the issue collector when in view mode, but I’m having trouble getting the logic right because it doesn’t actually call editpage.action.

if you just want to hide it with css in edit mode, you can do it by adding

body.contenteditor #atlwdg-trigger {
    display: none;

in /admin/viewstylesheet.action

Hi @TtheB, were you ever able to resolve this issue? I too am having difficulty detecting edit mode in due to the details you described.