[pmwiki-users] Default pagelists to list pages in current group only.

Patrick R. Michaud pmichaud at pobox.com
Tue Sep 4 13:11:04 CDT 2007


On Mon, Sep 03, 2007 at 11:05:47PM -0500, Captain Smack wrote:
> Hello,
> 
> How do I make it so that (:pagelist:) only lists pages from the current group? As of now I have this in my local config.php to exclude special pages:
> 
> ## Exclude Certain pages / groups from search results.
> $SearchPatterns['default'][] = '!\\.(All)?Recent(Changes|Uploads|Comments)$!';
> $SearchPatterns['default'][] = '!\\.Group(Print)?(Header|Footer|Attributes)$!';
> $SearchPatterns['default'][] = '!\\.(Left|Right|Side)(Bar|Menu|Note)$!';
> $SearchPatterns['default'][] = '!^Site\\.!';
> $SearchPatterns['default'][] = '!^PmWiki\\.!';
> 
> but I'd also like to have (:pagelist:) act like (:pagelist group={*$Group}:)

In local/config.php:

    $pagename = ResolvePageName($pagename);
    $group = PageVar($pagename, '$Group');
    $SearchPatterns['default'][] = "/^$Group\\./";

This causes the default pagelist to display only those pages
that are in the current group.  (The difference is the use of
a slash versus an exclamation point for the pattern -- an exclamation
point indicates patterns to be excluded, a slash indicates
patterns that are required.)

Pm




More information about the pmwiki-users mailing list