Need to display the page details in table format using user macro in confluence
Hi @Mrunal Kumar Lokku and welcome to the community,
I would take a look at these documentations:
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 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
Hi,
Can you please suggest the changes in the above macro for displaying all the pages details in confluence.
It looks like you're new here. Sign in or register to get started.