Display a page's current version

Richard Gundersen May 10, 2016

Hi

I'm using Confluence 5.7.4.

I was just asked how to display the current page version in the page without having to go to the page history menu. Is it possible to do? Do I need to use a user macro to do this? If it is only possible using macros, would the syntax be something like $content.version?

Thanks!

5 answers

1 accepted

5 votes
Answer accepted
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2016

Hi Richard,

A user macro should be the only easy way to do this, and your syntax seems to be right... why not test it? It should return exactly the version number of the page (i.e. "11" for v. 11).

Just make sure to include 

## @noparams

at the top of your user macro.

Richard Gundersen May 11, 2016

Great, thanks @Stephen Deutsch. Tried it out and it's as simple as:

## @noparams
$content.version

And now appears in my Macro browser (once I deleted all the comments - it doesn't seem to like it if you leave additional comments so my macro is literally just those two lines of code)

Didn't realise the macros would be so easy actually, that's why I was wary of trying it out smile

Many thanks for your help!

Like # people like this
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2016

No problem, glad I could help!

Michelle Oliveri March 7, 2018

We have the Cloud version of Confluence, and I would like to show the current version # on a PDF export.  Is this possible?   

Like # people like this
Nils Bier _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2018

Hi @Michelle Oliveri

Using Scroll PDF Exporter for Cloud you can simply define a placeholder in your template to display the revision number of the page you're exporting.

You can find further information about all the available placeholders in our documentation: for your case the "Page Revision" placeholder is the one to look at.

Hope this helps.

Best,
Nils

Evangelos Mantadakis June 21, 2018

Hi @Michelle Oliveri,

You can also use QC Documents for Confluence Cloud plugin to run the {qc-property-macro} . Using this macro you will be able to export the version of the context like this 

{qc-property-macro:property=Title}

The plugin is available for the Confluence Cloud.

More information is available here .

Like Brad Oaks likes this
Michelle Oliveri June 21, 2018

Hi @Evangelos Mantadakis

Thank you for your reply!  The solution looks very interesting.  I will let my manager know. 

Kindest regards,

Michelle

1 vote
Rodney Hughes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2021

The info under the page title shows the date and last author,

... but if you want to include this in any export, you can create a "layout" section on the page and choose an appropriate number of columns to make it look nice

Then insert the "Change History" change macro with 1 version to show

change history.png

Nasar Ibrahim March 25, 2022

@Richard Gundersen 

This solution looks good however can you guide me on  how to add this macro  all I can see is the standard macros provided by Atlassian 

When i enter code and publish it doesn't work - what ma i doing wrong :(

## @noparams
$content.version

 

/## @noparams
$content.version

Rodney Hughes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2022
Rodney Hughes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2022

But I have also recently added this plugin to our system

.. SUPER-great as you can display all sorts of special info

https://marketplace.atlassian.com/apps/1219863/information-about-page-plugin?tab=overview&hosting=server

0 votes
Nasar Ibrahim March 25, 2022

Hi 

Change history macro simply display all versions which like you  say is not much use for example version 56369  and all the proceeding versions listed

No way of limiting that view to the last say 10 ?  Can't see how you would edit macro  in Cloud version 

How did you get to Edit Change History Macro ???

Rodney Hughes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2022

Change History macro is only available in Server and Data Center

https://confluence.atlassian.com/doc/change-history-macro-154632795.html

Its only parameter is how many versions to show and the columns are set.

But this plugin allows you to select specific field to show, but also not available in Cloud

https://marketplace.atlassian.com/apps/1219863/information-about-page-plugin?tab=overview&hosting=server

Like Nasar Ibrahim likes this
Nasar Ibrahim March 28, 2022

Frustrating that there are so many differences between Cloud & Data Centre , never mind it is what it is

0 votes
Ian Mounsey June 10, 2021

My solution is to embed the Change History Macro inside a Table Filter Macro and set the Table Filter Macro (on the Table View tab) to only show 1 row.

0 votes
Rodney Hughes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2019

Hi ... just surfing around and saw this question .. apparently unanswered

The closest I found is the "Change History" macro but it simply displays ALL version history as seen on Page History via the ellipsis

Pity the macro doesn't have a setting for only showing the last version

 

But thinking a bit further ...

displaying page version "Version 5639" probably doesn't help very much

The date of the last page edit and the author is shown under the page title which probably makes more contextual sense than a version number

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events