How to hide elements from the site layout on the edit page?!

I would like to add elements to the site layout (the section above the global layout so I need to edit the main.vmd) and hide them on the edit page layout (otherwise they would overlap the editor window)

How can I do that? Checking for edit mode in main.vmd doesn't seem to work like in page.vmd

many thanks!

2 answers

1 accepted

1 vote
Accepted answer

How about to di this on the client side?

something like:

AJS.toInit(function(){
	if ( AJS.$("#main").is("#editpageform") ){
	       AJS.$("YOUR-ELEMENT-ID").hide();
	}
}

With this you check if your are on the edit-mode (The Main-Id contains the EditPageForm-Id). If true your Element will be hidden.

I hope I could help

Raffy

Hi

i did something like this using a velocity processed mesage customfield

https://answers.atlassian.com/questions/114724/how-to-modify-this-code-to-add-restrictions-to-a-projectrole

you could install Jira Toolkit Plugin to get this type of custom fields...

in your case you should create a new

Message Custom Field (for edit)

A custom field whose default value will be displayed as HTML an 'Edit' screen.
then add some jscript code as default value to it and you should be done

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

840 views 41 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you