Moldy Oldies

How can you determine if old content is "moldy" (stale) or simply doesn't need to be changed regularly?

Wiki is terrific. Anyone can add pages. However, if you don't have a dedicated Wiki librarian, content can become stale. I wanted a relatively easy way to mark "old" pages and ask for feedback: is this content still useful?

I installed a custom view template and combined that with a comment form. Pages older than a pre-defined date now appear with an extra block of text at the top:

  • Screenshot of the top of an "old" page

Any "votes in favor" of the usefulness of the page are added to a list (table) on a MoldyOldies page.

  • Screenshot of the "votes" in favor of old pages:

The computer keeps track. Pages no-one visits never get a vote. Over time, I'll be able to use the "votes" to determine which old pages are truly outdated and should be archived or removed vs. which are valuable (and, perhaps, should have their date stamp updated. :)

Steps to Create a Moldy Oldies Tracker

  1. Define several useful global variables, including a variable that stores my definition of "old".
  2. Create a custom view template, wrapping the standard skin view template. I use PatternSkin so I'm starting from view.pattern.tmpl. See System/TemplateTopics for details regarding customizing the view template.
  3. Create a comment template (or use one you already have). I created a template that captures the name of the page being viewed, as well as the comment date, commenting user, the comment (optional) and the REVINFO of the page. This information is appended to a table on a single tracking page.
  4. Enable the Moldy Oldies Tracker.

Global Variables

My view template uses several global variables.

SHELFDATE defines "old".

   * Set SHELFDATE = 01 Jan 2007

PAGEAGE prints the last-modified date of the current page.

   * Set PAGEAGE = This page was last modified: %RED% %REVINFO{"$date"}% %ENDCOLOR% 

HILITE_PINK highlights the background behind some text. I used pink to avoid conflicting with the default BROADCAST_MESSAGE color.

   * Set HILITE_PINK = <span style="background-color: #FFCCFF;">
   * Set END_HI = </span>

(Note: our Wiki already had HILITE_PINK defined, as well as variants for green, purple, blue, yellow, and orange. We've found these to be generally useful on many pages.)


My view template imports the default Wiki view template, then wraps the body text of the page in a test for age. For simplicity, I named my template page WebViewTemplate.


%TMPL:DEF{"topiccomment"}% $NOP(%)HILITE_PINK$NOP(%) <b><i>$NOP(%)PAGEAGE$NOP(%)</i> %BR% Please let us know if the content is still useful.</b> $NOP(%)END_HI$NOP(%) %BR% $NOP(%)COMMENT{type="topiccomment" target="MoldyOldies"}$NOP(%) <hr> %TMPL:END%

%TMPL:DEF{"textcontent"}%<div class="patternTopic">%TMPL:P{"broadcastmessage"}% 

%CALC{$IF(%REVINFO{"$epoch"}% > 86400, $IF($TIME(%SHELFDATE%) > %REVINFO{"$epoch"}%, %TMPL:P{"topiccomment"}% , ), ) }%


</div><!-- /patternTopic-->%TMPL:END%

Notes on the Template

1. I defined topiccomment in my template to avoid causing the IF statement to become large and unwieldy.

3. Ephemeral pages, e.g. the page that says "This topic does not exist" do not have a modification date. I needed to configure my "old" test so that these pages weren't marked. So, the first thing I do is ensure that the ppage has a datestamp and it's newer than January 1, 1970.
$IF(%REVINFO{"$epoch"}% > 86400

2. In older versions of TWiki, the $epoch argument to %REVINFO% was not yet supported. If you have an old version of TWiki, you can calculate seconds, using
instead of

The sample WebViewTemplate code shows the more "modern" way. If your Wiki is old, use $TIME(%REVINFO{"$date"}%

Comment Template

My comment template provides a simple one line text box. It writes the results to a table in another page. That table collects results from any use of the template in any page in the Wiki.

   %COMMENT{type="topiccomment" target="SomeOtherPage"}%

Result forat:
  | Topic | Comment Date | Commenter | Comment text | Rev Info |

If you've never created a comment template, see System.CommentPlugin for details .


Your response will be "signed" with your Wiki name and dated with today's date.  %BR%
<input %DISABLED% type="hidden" name="base_topic"  value="%TOPIC%" /> %BR%
<input class="twikiInputField" %DISABLED% type="text" size="100" name="comment_text" id="comment_text" value="" /> %BR%
<input %DISABLED% type="submit" class="twikiButton" value="%button|Submit%" /> 

%TMPL:DEF{OUTPUT:topiccomment}%%POS:AFTER%| %URLPARAM{"base_topic"}% | %DATE% | %WIKIUSERNAME% | %URLPARAM{"comment_text" }% | %REVINFO{topic="%URLPARAM{"base_topic"}%" "$date - $wikiusername"}%  |  %TMPL:END%

Enable the Moldy Oldies Tracker

When all the pieces are in place, enable the Moldy Oldies tracker by setting VIEW_TEMPLATE in WebPreferences.

   * Set VIEW_TEMPLATE = Apps.WebViewTemplate

Update the Datestamp on Useful Pages

When a page is marked as useful, I update it by adding a block of Wiki code at the end, like this:

%TWISTY{showlink="datestamp updated 06 Aug 2008"}%

content last updated %BR%
  09 Sept 2006 - 14:29:58 UTC - Main.MarySample

page timestamp updated - 06 Aug 2008 %BR%
-- Main.VickiBrown 

This page has had at least one vote in favor of its continued value ([[MoldyOldies]]). %BR%
      21 Jul 2008  Main.AnnWhite -- "I refer to this daily"


This logs the comment and removes the "moldy oldies" form from the top of the page.

Topic revision: r2 - 31 Mar 2014, VickiBrown
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CFCL Wiki? Send feedback