Need to display the page details in table format using user macro in confluence
The general doc is here: https://community.atlassian.com/t5/Confluence-questions/How-to-get-all-the-page-details-such-as-PageName-CreationDate/qaq-p/2356767
Note that when you work with user macro context objects, those are instances of the corresponding internal Java classes. Therefore, if you want to work with page objects,
Resources:
All in all, the page name and creation date can be accessed like this assuming that the object is "$page":
${page.displayTitle}
${page.creationDate}
...
Hi @Mrunal Kumar Lokku and welcome to the community,
I would take a look at these documentations:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
I tried the following macro but this macro is page specific. So, can you please help me for modifying this macro in such a way that I can get all the page details?
## @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>
Thanks,
Mrunal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you please suggest the changes in the above macro for displaying all the pages details in confluence.
Thanks,
Mrunal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.