Displaying version of page on a page

Permalink
Hi all...is there an easy way to display a particular version of the page, on that page?

I was looking at the "page hit counter" block from the Market, and it seems to do a little of what I want to do....I essentially want to show the current version of the page, on the page.

I have the "Print to PDF" block on a page, and I want to make sure that when people look at the PDF, that they can go back to the website and make sure that the version they are looking at is indeed the latest version by comparing version numbers.

Is there a way to get the current version number of the page returned? I tried looking through the API but did not see anything quickly jumping out at me.

Thanks!

pendragn
 
xaritas replied on at Permalink Best Answer Reply
It's not part of Page, it's part of Collection. It looks like you can call

// assumes $c is your current page
$c->getVersionObject()


which will give you one of these:http://www.concrete5.org/api/Pages/CollectionVersion.html...

The CollectionVersion object has several methods on it to get versions by date, name, or numerical id. There is also a shortcut $c->getVersionID(), which gives you the numeric version directly.

Personally, I find that people work better with "current as of dates" than version numbers.

If you want to list multiple versions, look at how the VersionList is used in concrete/tools/versions.php to populate the Dashboard.
pendragn replied on at Permalink Reply
pendragn
This is great! Thanks!!