Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,120
Community Members
 
Community Events
165
Community Groups

How do I disable the create page button for a specific space?

Edited

Hi,

I need to disable the creation button for specific spaces.

I found the code below that disables the creation button for all spaces. I need help adjusting it so I can still create pages in other spaces...

<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#quick-create-page-button').hide();
});
</script>

Any tips would be appreciated.

Thanks!

1 answer

1 accepted

2 votes
Answer accepted

Hi @Guy Toyber

may I ask why you want to disable the creation button? How about using Confluence's space permissions in order to control who's able to create pages for specific pages in spaces? You can define per group or user who's able to do so. You could also restrict everyone from creating pages.

This way, you also prevent the creation of pages via the REST API.

Cheers,
Matthias.

Hi @Matthias Gaiser _K15t_ 

Our Confluence is being migrated from Server to Data Center.

Before a space export we do restrict all users from editing. In this mode "edit" page is hide but "Create" page is visible.

Users can still create pages in other spaces, and since the create button is still visible the scenario of a user that will visit the limited space and will want to published a page there -  it can happen - but the page will be published in another space.

In other words, the user intention will be to create a new page in the limited space but the result will be a new page in another space.

So to be on the safe side and to avoid confusion I would like to hide/disable the create button.

 

Regards,

Guy

I understand, @Guy Toyber. Thank you for your explanation - that makes sense to me then. And I think I have a solution for you. This call

AJS.Meta.get("space-key")

returns the current space key you are in. If you include that into an if statement into your code, you could check if the space key matches one of your moved ones.

Hope that helps,
Matthias.

Hi @Matthias Gaiser _K15t_ ,

I appreciate your help so far, would you mind to paste the entire code? It did not work for me...

Additionally, If I would like to hide another create button on additional space, how it will work? 

 

Regards,

Guy

Like Matthias Gaiser _K15t_ likes this

Hi Thiago,

Thanks for the info, its now working perfect!

I appreciate your help!

 

Regards,

Guy

Like Matthias Gaiser _K15t_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

150 views 1 3
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you