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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

872 views 21 10
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