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
Answer accepted

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
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,382 views 2 13
Read article

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