The Metadata Plugin
Metadata Management for Manila
 
Site last updated
2/24/2006; 12:33:21 PM
 
Home

Why

Features

FAQ

Updates

Documentation

Download

Developers

Bugs

Feedback

Discuss

Planned
Features

 
 

The recentlyChangedPages() Macro

Now it's easy to have a list of recently updated pages on your site. The Metadata Plugin keeps track of them for you. All you have to do is insert the following macro into your page:

{metaDataMacros.recentlyChangedPages("3")}

In this case I'm asking for the most recent 3 pages to be updated. Let's try it out! Here are the three most recently updated pages on this site:

This macro contains some optional parameters. Here's the full syntax:

{metaDataMacros.recentlyChangedPages (numPages,header="<ul>",footer="</ul>",
beforeItem="<li>",afterItem="</li>",limitTo="",dateformat="",onlyPagesWithPaths=false)}

So if I want to show the date and time each page was updated, I could say

{metaDataMacros.recentlyChangedPages("3",afterItem:" {-lastUpdate}")}

What if I want to get fancy and include who updated it? Easy. We just use another built-in meta type, member:

{metaDataMacros.recentlyChangedPages("3",afterItem:" {-lastUpdate} by {member}")}

Notice I put a hyphen before lastUpdate. That's to work around a bug in Manila, where the macro gets expanded before the Plugin can see it. If I didn't put the hyphen there, the lastUpdate time of this page would be used.

Note also that I can control the format of dates using the dateformat parameter. It can be set to shortstring, longstring, or abbrevstring. Here's an example:

{metaDataMacros.recentlyChangedPages("3",afterItem:" {-lastUpdate} by {membername}",dateformat:"shortstring")}

By default, the Metadata Plugin keeps track of the last 50 changed pages. This number can be changed by changing [yourManilaWebsite].#plugins.data.metaData.prefs.maxRecentChangedPages.

Sometimes you want to limit the results returned from this macro to only Stories or only nonstories. For example, if you have a Manila site you may want to show changes that happen to regular pages in your site (Stories) but not discussion group messages. In that case, you'd want to set the limitTo parameter to stories. You could also set it to nonstories to show only the most recently changed DG messages. By default, both Stories and nonstories are returned.

Sometimes you want to edit pages covertly. You may notice a typo on an older page and want to change it without the page being entered on the recentlyChangedPages list. That's why there's a little checkbox that you'll see when editing pages that says Do not write this update to the recently changed pages list. Check the box and your editing will not affect the recentlyChangedPages list.

Note that the siteLastModified() macro will show that the site has changed. Why? Because that macro just looks at the age of the cache table, and you've changed the cache table by editing a page.

If you're doing static rendering, set the onlyPagesWithPaths parameter to true and all pages without set paths (i.e., all nonstatic pages) will be filtered out.

Comments...


This page last updated Thursday, July 26, 2001 at 9:29:51 PM. (9798)