How to override quick create page button in Confluence 5.9.x

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Purpose

In Confluence 5.9.x, quick Create page button is introduced. For more information on this, please refer to Confluence 5.9 Release Note

If you need to redirect the link in the Create button to Create Blogpost instead, you may do so by using JavaScript as per highlighted below.

Solution

  1. Navigate to Confluence Administration page >> Custom HTML.
  2. Click Edit.
  3. Add the following to At the end of the HEAD section and click Save:

    If the user does not have a Personal Space created, then the script below will not work.

    The user will get Page Not Found error instead.

    Workaround: Use pre-defined space for all users instead of personal space. Just

    <script>
      AJS.toInit(function(){
          AJS.$('#quick-create-page-button').attr("href", "/pages/createblogpost.action?spaceKey=~" + AJS.params.remoteUser);
      });
    </script>
  4. You can also use pre-defined Global template (please replace <numbers> with entityId of the template which can be found in URL during editing the template)

    <script>
      AJS.toInit(function(){
          AJS.$('#quick-create-page-button').attr("href", "/pages/createpage-entervariables.action?templateId=<numbers>&spaceKey=~" + AJS.params.remoteUser);
      });
    </script>
  5. Below is an example also to use pre-defined Global template and create as a subpage to your current page (please replace <numbers> with entityId of the template which can be found in URL during editing the template)
<script>
AJS.toInit(function(){
      AJS.$('#quick-create-page-button').attr("href", "/pages/createpage-entervariables.action?templateId=<numbers>&spaceKey="+AJS.params.spaceKey+"&fromPageId="+AJS.params.pageId);
});
</script>



Last modified on Feb 2, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.