|
Cookbook /
RecentChangesExcerptSummary: How to display a list of last n RecentChanges
Version: 1
Maintainer:
Categories: Administration Links
QuestionHow can I display only a list of the last n pages modified on a site, e.g., in a sidebar? AnswerThe simple answer is to do a partial include of a "recent changes" page, as in:
Unfortunately, with the author, date, and other information the default format for the recent changes pages is a bit long to display in a sidebar. One solution is to define other recent changes pages that have exactly the format we want. The following can be placed in
$RecentChangesFmt['Site.LastChanged'] = '* [[$Group.$Name]] ';
This says to create and maintain a page called The RecentChanges code uses these two spaces to determine
The RecentPages page will only contain those edits that happened after you configured it. So it will be empty until the first edit. Once this page has been created, one can easily do the following to display the names of the last five recently changed pages on a site:
NotesI added the line starting "The RecentChanges code" based on a message on the mailing list. menachem January 29, 2005, at 09:40 PM QuestionHow do I make AnswerAdd the following to if (preg_match('![./]RecentChanges$!', $pagename))
$DefaultPageTextFmt = '(:include Site.AllRecentChanges:)';
Another solution: Redefine in config.php or a specific Group.php: You would not need to delete any pages for this. - HansB Contributors
QuestionEven though I use the lines=5 option, it gives me a list of all the changes. So the lines option is ignored. How can I fix that? AnswerTo be able to use the lines=5 option, you'll have to use the Markup directive instead of the Wiki directive. Example of the template code:
QuestionThis only lists the first 5 records from RecentChanges... but not the 5 last records !!!! How to fix that? AnswerThis is what I used in mine and seems to work just how you looking for See also |