|
|
|
|
|
{page-info} Macro
The {page-info} macro allows you to display several useful pieces of information about the page in a simple format
Overview
This macro allows you to display the following information in various configurations:
- Who created the page, and when
- Who last modified the page, and when
- A list of everyone that has edited the page
- A list of everyone who has added comments to the page
- The current version, and date, of the page
- A list of all versions of the page, and "diffs" between versions
- Page title and "Tiny URL"
- A list of all labels associated with the page
Macro Syntax
Add the macro to your page as follows:
Parameters
| Parameter |
Default |
Required |
Notes |
| default |
|
 |
The default "displaytype" parameter is the name of the piece of information you wish to see displayed, this may be one of the following:
- created-user - displays the user who created the page
- created-date - displays the date the page was created
- modified-user - displays the user who last modified the page
- modified-users - displays a comma separated list of all the users who have modified the page
- modified-date - displays the date the page was last modified
- participants - displays a comma separated list of the users who have modified or commented on the page
- commenters - displays a comma separated list of the users who have commented on the page
- current-version - displays the most recent version number for the page
- versions - displays a comma separated list of version numbers, clickable to take you to view that version
- diffs - displays a comma separated list of version numbers, clickable to take you to view the differences between that version and the next version
- labels - displays a comma separated list of labels, clickable to allow you to view other pages which posess that label
- tinyurl - displays a tinyurl link to the specified page
- title - displays the title of the specified page
- pageId - displays the Id of the current page
|
| page |
current page |
 |
The name of the page whose information you wish to display, if none is given then the current page is assumed. You can also use @self to refer to the current page and @parent to use the parent page. |
| dateFormat |
Default Date Format |
 |
Allows setting the display format for the date and time displayed, when do dat is to be displayed this parameter has no effect. Details of the pattern syntax may be found Date Formats. |
| type |
flat |
 |
For those display types that produce a list of information, you can specify:
- flat - display a comma separeated list (default)
- list - display a bullet list
|
| prefix |
|
 |
When displaying a version numbers you may use this parameter to insert a prefix before the version number. Has no effect with those display types which do not display a version number. |
| reverse |
false |
 |
When displaying a list of items, you can set this parameter to true to reverse the order of those items. |
| count |
show all |
 |
If you want to limit the number of items shown in a list (eg. versions and diffs) define the number of items to be shown with this parameter. |
| showComments |
false |
|
Display the comments that accompany an update. |
| showVersions |
true |
|
Display the version numbers. |
License and Availability
See: Page Information Tools Plugin
Examples
Displaying the current page's author
Displaying the current page's creation date
Which looks like:
Mar 23, 2006 00:31
Displaying author and date
Which looks like:
This page was created by Alain Moran
on Mar 23, 2006 00:31
Displaying the name of the person who last modified the current page
Displaying the date that the current page was last modified
Which looks like:
Oct 02, 2008 16:22
Displaying last modifier and modification date
Which looks like:
This page was modified by James Lowry
on Oct 02, 2008 16:22
Formatting dates
By default, dates and times are shown using the format defined in Confluence's General Configuration. However, you can alter this format by using the Date Formats syntax as shown in some of the examples below:
Which results in:
Default format: Mar 23, 2006 00:31
Custom date-only format: Error formatting macro: page-info: java.lang.IllegalArgumentException: Illegal pattern character 'Y'
Custom date/time format: Error formatting macro: page-info: java.lang.IllegalArgumentException: Illegal pattern character 'Y'
For more information on this syntax, please see our tutorial on Date Formats.
Listing the participants in a page
Listing users that have commented on a page
Listing users that have modified the page
If you only want to list people who have modified (edited) a page, use the following notation (both formats shown):
Which results in:
Page editors: Alain Moran
, Guy Fraser
, James Lowry
Displaying the current page version
If for some reason you need to display the version number of the current page, you can do this using the following notation:
Resulting in:
This page is at version 48!
Listing the versions of the page
Possibly more useful is to be able to display a list of the versions that a page has gone through:
Which generates a comma separated list as can be seen below:
48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Reversing list order and limiting number of items
You can reverse the order of any list with the reverse parameter:
Which gives a reversed list (compare to previous example):
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48
This is particularly useful when you want to limit the number of items shown as you can then show the last 5 versions for example:
Which gives:
1, 2, 3, 4, 5
Prefixing the version number
You can also prefix text to the version numbers as shown in the example below:
Which gives:
Version 48, Version 47, Version 46, Version 45, Version 44, Version 43, Version 42, Version 41, Version 40, Version 39, Version 38, Version 37, Version 36, Version 35, Version 34, Version 33, Version 32, Version 31, Version 30, Version 29, Version 28, Version 27, Version 26, Version 25, Version 24, Version 23, Version 22, Version 21, Version 20, Version 19, Version 18, Version 17, Version 16, Version 15, Version 14, Version 13, Version 12, Version 11, Version 10, Version 9, Version 8, Version 7, Version 6, Version 5, Version 4, Version 3, Version 2, Version 1
Displaying list information as a bullet list
You can output the versions in a bulleted list as follows:
This puts the versions in to a bulleted list:
Displaying "diff" links
You can create a list of page versions which, when clicked, will show the differences between that version and the next version:
Which gives:
48-47, 47-46, 46-45, 45-44, 44-43, 43-42, 42-41, 41-40, 40-39, 39-38, 38-37, 37-36, 36-35, 35-34, 34-33, 33-32, 32-31, 31-30, 30-29, 29-28, 28-27, 27-26, 26-25, 25-24, 24-23, 23-22, 22-21, 21-20, 20-19, 19-18, 18-17, 17-16, 16-15, 15-14, 14-13, 13-12, 12-11, 11-10, 10-9, 9-8, 8-7, 7-6, 6-5, 5-4, 4-3, 3-2, 2-1
Displaying "Tiny URL" for a page
The "Tiny URL" is a shortened URL for the current page that's useful if you're sending the link in emails, etc.
Which gives:
Tiny URL: page-info macro
Displaying page title
You can display the title for the current page as follows:
Which gives:
page-info macro
If you want the page title to be linked, use the "tinyurl" option (see previous example).
See also: builder-pagetitle macro
Listing the labels on the page
Showing information about another page
On occasion it may also be useful to specify a different page to the current one to be the page whose information is being displayed:
Guy Fraser
This page parameter may be set to @parent which refers to the parent of the current page. For example, you can display a link to the parent page with the "tinyurl" setting like this:
Navigation and Lists
Showing Edits and the accompanying comment
You can use the showComment parameter to list the comment along with edit like this.
This will result in output like this:
48-47 (Added an example of showing comments without version numbers.), 47-46 (Added an example for showComment.), 46-45, 45-44, 44-43, 43-42, 42-41, 41-40, 40-39, 39-38, 38-37, 37-36, 36-35, 35-34, 34-33, 33-32, 32-31, 31-30, 30-29, 29-28, 28-27, 27-26, 26-25, 25-24, 24-23, 23-22, 22-21, 21-20 (fixed link to issue tracker), 20-19, 19-18 (text ammends, moved scrollbar above page title, some changes to example 5), 18-17 (Text ammends), 17-16, 16-15, 15-14, 14-13, 13-12, 12-11, 11-10, 10-9, 9-8, 8-7, 7-6, 6-5, 5-4, 4-3, 3-2, 2-1
Showing Edit Comments without version numbers
You can use the showComment=true parameter to list the comment and showVersion=false to hide the number like this:
This will result in output like this:
48-47 (Added an example of showing comments without version numbers.), 47-46 (Added an example for showComment.), 46-45, 45-44, 44-43, 43-42, 42-41, 41-40, 40-39, 39-38, 38-37, 37-36, 36-35, 35-34, 34-33, 33-32, 32-31, 31-30, 30-29, 29-28, 28-27, 27-26, 26-25, 25-24, 24-23, 23-22, 22-21, 21-20 (fixed link to issue tracker), 20-19, 19-18 (text ammends, moved scrollbar above page title, some changes to example 5), 18-17 (Text ammends), 17-16, 16-15, 15-14, 14-13, 13-12, 12-11, 11-10, 10-9, 9-8, 8-7, 7-6, 6-5, 5-4, 4-3, 3-2, 2-1
Hints and Tips
None at present.
Frequently Asked Questions
None at present.
Issue Tracker
Adaptavist maintain a JIRA Project for tracking bug reports and feature requests for this macro. The currently reported items are shown below:
See Also
|
|
|
|
|
|
| |
This is a comment ... Guy, would you care to comment?
Yes, I would
The macros above will surely pick up on the fact...
And here is an anonymous comment (actually made by Guy)
After installing Builder 2.0.1 I am getting joda errors similar to one described for scaffolding plugin (using c.2.2.9 with utilities plugin 2.1.3): page-info: java.lang.NoSuchMethodError: org.joda.time.format.DateTimeFormat.getInstance()Lorg/joda/time/format/DateTimeFormat;
Is there a parameter that allows me to view restrictions in a page. If a page is restricted and I view Page Information from the menu bar, then I get to see if a page has been restricted. Can I use the same info but place it on normal pages?
Is there a way to add the participants of a page in every wiki page (i guess make it part of the layout).
Is there a way to show trackback links from page info?
Hi,
I display an excel file on a page by attaching it to the page and using the excel macro.
Is there a way to show on the page the last uploaded date of the excel file?