[pmwiki-users] WebFeeds recipe

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 13 20:04:00 CST 2007


On Tue, Feb 13, 2007 at 06:57:13PM +0100, sgp wrote:
> The webfeeds recipe suggests using
> 
> $FmtPV['$MarkupExcerpt'] = 'substr($page["text"], 0, 200)'; 
> 
> then use $MarkupExcerpt in the RSS description 
> 
> $FeedFmt['rss']['item']['description'] = '$MarkupExcerpt'; 
> 
> This does not seem to work for the latest stable release.
> Is there another way? 

Yes, the documentation is wrong.  Here's a version
that I _think_ will work:

    function MarkupExcerpt($pagename) {
      $page = RetrieveAuthPage($pagename, 'read', false);
      return substr(@$page['text'], 0, 200);
    }

    $FmtPV['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';
    $FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';

Pm



More information about the pmwiki-users mailing list