[pmwiki-users] Is there a way to display the number of revisions for a page?

Patrick R. Michaud pmichaud at pobox.com
Sun Jan 30 13:27:47 CST 2005


On Sun, Jan 30, 2005 at 11:14:46AM -0800, Noel Llopis wrote:
> 
> Ah, it seems that it works inside the wiki body, but not when I put it as 
> part of the template. I was hoping to put this in my template:
>        <a href='$PageUrl?action=diff'
>         title='$[History of this page]'>$[History]</a> {$Rev} |
> 
> Is there a way to expose that {$Rev} variable as a php variable so we can 
> use it just like $Version for example?

Solution 1:  Use <!--markup:...--> in the template, as in

     <a href='$PageUrl?action=diff'
       title='$[History of this page]'>$[History]</a> <!--markup:{$Rev}--> |

Solution 2:  Add the following to config.php

   $FmtP['/\\$PageRevisions/e'] =
     '@$PCache[$pagename]["rev"]+0';

Then you can use $PageRevisions in a template:

     <a href='$PageUrl?action=diff'
       title='$[History of this page]'>$[History]</a> $PageRevisions |

Pm



More information about the pmwiki-users mailing list