[pmwiki-users] Modifying format of RecentChanges?

Patrick R. Michaud pmichaud at pobox.com
Sat Jan 29 16:14:08 CST 2005


On Sat, Jan 29, 2005 at 11:04:21AM -0800, Noel Llopis wrote:
> Is there any way to control the format of the output of RecentChanges? 
> (without modifying pmwiki's original code that is).
> 
> I'd like to provide a link for the page history with each change. I would 
> also like to de-emphasize the date and maybe align things a bit. Any easy 
> way to do those things?

The format of RecentChanges is controlled by the $RecentChangeFmt
array, which can be adjusted in local customization files.

The default setting is
    $RecentChangesFmt = array(
      'Main.AllRecentChanges' =>
        '* [[$Group.$Name]]  . . . $CurrentTime $[by] $AuthorLink',
      '$Group.RecentChanges' =>
        '* [[$Group/$Name]]  . . . $CurrentTime $[by] $AuthorLink');

which gives the different formats for Main.AllRecentChanges and
the per-group RecentChanges files.

You can adjust these (or add new pages) by simply setting the
appropriate array entry.  For example, if you want to have a link to the
page history for each change, you can do so with:

   $RecentChangesFmt['$Group.RecentChanges'] =
     '* [[$Group/$Name]]  [[$Group/$Name?action=diff |(diff)]] . . . $CurrentTime $[by] $AuthorLink';

Note the existence of two consecutive spaces following the link to the page.
The RecentChanges code uses these two spaces to determine (1) that line
is formatted by RecentChangesFmt, and (2) where the page-name-specific
information ends (for removing the appropriate lines when updating page).

Pm



More information about the pmwiki-users mailing list