Remove an item from the Add Page menu

Brian Bircham June 25, 2013
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
Answer accepted
Brian Bircham July 2, 2013

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>
2 votes
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2013

This works in Conf 4.2:

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

Add it to your "Custom HTML".
PeterKoczan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 25, 2013

Just one thing to add: put it between

<script type="text/javascript">

and

</script>

Brian Bircham June 25, 2013

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?

0 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 1, 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;

0 votes
PeterKoczan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 25, 2013

Hi Brian,

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

Thanks,

Peter

Brian Bircham July 1, 2013

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
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2013

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events