User Macro to display the Page Information in Confluence

お困りですか?

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

コミュニティに質問


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

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.

*Fisheye および Crucible は除く

要約

This KB is to help you write an User Macro to display the Page Information (Page Name, Last modified by, Last modified Date, Creator) on Confluence Pages.

ソリューション

Be mindful that customisations are not part of our support scope as per Atlassian Support Offerings. Any effort provided to support issues related to customisation will be on a best-effort basis by the support engineer.

The following User Macro could help:

  1. Go to icon > General Configuration > User Macros
  2. Choose Create a User Macro
  3. Enter the macro details template

    1. ## @param Page:title=Page|type=confluence-content|required=true|desc=Choose Page to get the Information for
      #set ( $colonIndex = $paramPage.indexOf(":") )
      #if ( $colonIndex == -1 )
      #set ( $spaceKey = $space.key )
      #set ( $pageName = $paramPage )
      #else
      #set ( $spaceKey = $paramPage.substring(0, $colonIndex) )
      #set ( $pageNameIndex = $colonIndex + 1 )
      #set ( $pageName = $paramPage.substring($pageNameIndex) )
      #end
      #set ( $requestedPage = $pageManager.getPage($spaceKey, $pageName) )
      <table>
        <tr>
          <td>Page Name</td>
          <td>Page Creator Name </td>
          <td>Last Modified Date</td>
           <td>Last Modifier </td>
        </tr>
      <tr>
      <td>$requestedPage.getTitle()
      <td>$requestedPage.getCreatorName()</td>
      <td>$action.dateFormatter.formatDateTime($requestedPage.lastModificationDate)</td>
      <td>$requestedPage.getLastModifierName()</td>
      </tr>
      </table>
      • [追加] をクリックします。
      • Use the user macro in the page
      • 結果の例

To know more on User Macros, please refer the below document

Last modified on Mar 1, 2021

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

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