Remove an item from the Add Page menu

Hello all I'd like to remove the "Add Page" menu item from the Add Page menu so that it forces people to use the template. I think this may be possible based on this article but I could be wrong https://answers.atlassian.com/questions/25187/how-to-promote-use-of-existing-templates-with-new-add-menu-options Is it possible to remove an item altogether? Thanks in advance Brian

5 answers

1 accepted

0 votes
Accepted answer

I couldn't get the AJS scripts to work to fix this issue. In the end, I used JavaScript to remove the entry with the following

<script>
document.getElementById('add-page-item').style.display= "none";
</script>

This works in Conf 4.2:

AJS.$('#add-menu-link-space li:first').remove();

Add it to your "Custom HTML".
Peter Koczan Atlassian Team Jun 25, 2013

Just one thing to add: put it between

<script type="text/javascript">

and

</script>

This didn't seem to work unfortunately. I'm using version 4.2.4 version of Confluence and added the script tags. Do I need to enable JavaScript somewhere?

The easiest way to do this would be to just add a little jQuery that removes the first item in the drop down list. I've used jQuery before to customize my menus like that and it works great.

0 votes
Peter Koczan Atlassian Team Jun 25, 2013

Hi Brian,

Can you let me know the Confluence version you are using?

Thanks,

Peter

Hi Peter

I'm using 4.2.4 and unfortunately the script didn't work (even with the script tags)

Any ideas? Do these scripts need to be enabled somehow?

0 votes
David Simpson Community Champion Jul 01, 2013

@Brian Bricham: Matthew's answer was almost right, but really it the JS needs wrapping in an AJS.toInit method...

In Confluence Admin | Look & Feel | Custom HTML paste this into At the End of the BODY:

&lt;script&gt;
  AJS.toInit(function(){
    AJS.$('#add-menu-link-space li:first').remove();
  });
&lt;/script&gt;

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,084 views 17 14
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