Displaying the latest page revison and the last update date
Asked by David Gibbons:

Hi,

I'm trying to create a user macro that displays the latest page version and the date the latest page was created. (Its part of a project to manage version control). I know the Change History macro exists but its too verbose.

I started to write a user macro as follows:

## Macro title: Page Version

## Macro has a body: N

## Body processing: No macro body

##

## Developed by: David Gibbons

## Date created: 09/12/2015

## Installed by:

## @noparams

\<p\>Confluence $generalUtil.versionNumber\<p\>

\<p\> Page Version $confPage.version\</p\>

\<p\> Page Version $confPage.versionComment\<p\>

When the macro runs it will display the current Confluence version but won't display the page version. Am I using the right variable or should I be using a different method,

Thanks,

Dave


Answers:
author: Alex Medved _ConfiForms_
body: Hi

|------------|------------------------------------------------------------|
| `$content` | is the variable which holds reference to your current page |

```
## @noparams&lt;p&gt;Confluence: $generalUtil.versionNumber&lt;p&gt;&lt;p&gt; Page Version: $content.version&lt;/p&gt;&lt;p&gt; Page Version comment: $content.versionComment&lt;/p&gt;
```

from <https://confluence.atlassian.com/conf54/confluence-administrator-s-guide/managing-add-ons-and-macros/enabling-and-configuring-macros/writing-user-macros/guide-to-user-macro-templates>

Objects available to your macro {#toc-hId-1676257851}
-----------------------------------------------------

Including the macro body and parameters, the following Confluence objects are available to the macro:

|                  Variable                   |                                           Description                                           |                                                                              Class Reference                                                                              |
|---------------------------------------------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `$body`                                     | The body of the macro (if the macro has a body)                                                 | String                                                                                                                                                                    |
| `$paramfoo`, `$parambar`, ...`$param<name>` | Named parameters ("foo", "bar") passed to your macro.                                           | String                                                                                                                                                                    |
| `$config`                                   | The `BootstrapManager` object, useful for retrieving Confluence properties.                     | [BootstrapManager](http://docs.atlassian.com/com/atlassian/confluence/atlassian-confluence/latest/index.html?com/atlassian/confluence/setup/DefaultBootstrapManager.html) |
| `$renderContext`                            | The `PageContext` object, useful for (among other things) checking`$renderContext.outputType`   | [PageContext](http://docs.atlassian.com/com/atlassian/confluence/atlassian-confluence/latest/index.html?com/atlassian/confluence/renderer/PageContext.html)               |
| `$space`                                    | The `Space` object that this content object (page, blog post, etc) is located in (if relevant). | [Space](http://docs.atlassian.com/com/atlassian/confluence/atlassian-confluence/latest/index.html?com/atlassian/confluence/spaces/Space.html)                             |
| `$content`                                  | The current `ContentEntity` object that this macro is a included in (if available).             | [ContentEntityObject](http://docs.atlassian.com/com/atlassian/confluence/atlassian-confluence/latest/index.html?com/atlassian/confluence/core/ContentEntityObject.html)   |


Tags: confluence-administration