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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

967 views 23 12
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