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

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。

目的

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.

ソリューション

  1. Navigate to Confluence Administration page >> Custom HTML.
  2. 編集をクリックします。
  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>



最終更新日: 2023 年 2 月 2 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.