[pmwiki-users] PageList containing articles made by users

Pico pmwiki at ben-amotz.com
Mon Oct 16 06:34:12 CDT 2006


Wouter Groeneveld wrote:
> Hi,
> 
> 
> I am trying to create a pagelist wich displays a list of all pages 
> created by a certain person. The standard example found here: 
> http://www.pmwiki.org/wiki/Cookbook/PagelistExplained 
> <http://www.pmwiki.org/wiki/Cookbook/PagelistExplained> is
> 
> |(:pagelist link=Profiles.{$Title} order=-time fmt=simple:)|
> 
> But that does not work, since all my links are created in the 
> GroupHeader. This example does work if I explicit add a link to the 
> articles/x page like this: [[Profiles/User]]. For example, I have a 
> group "articles" and that GroupHeader contains
> 
> %right%[-By [[Profiles/{$LastModifiedBy}]]
> 
> and the pagelist does not pick this up. Is there any way to do this?
> I tried using LocalTemplates and something like
> 
> (:if equal {=$LastModifiedBy} {$Profiles.{=$LastModifiedBy}} :)
> print the page
> (:if:)
> 
> but that does obviously not work and I'm kind of stuck. Is there a 
> simple way to use page directives wich also scan the links of the 
> headers like my example?
> 
> 

A last modified by template should work, but you have to match the 
{=$LastModifiedBy} to a corresponding profile name (without the Profile 
Group.  For example, a template like this could be run from anyone's 
profile page (or a header or footer) and it would match 
{=$LastModifiedBy} to the {$Name} of that (profile) page that is is 
being run from:

[[#lastmodbyme]]
(:if equal {=$LastModifiedBy} {$Name}:)
#[[{=$Group}.{=$Name}]] . . . {=$LastModifiedHost} . . . 
{=$LastModified} (:if:)
[[#lastmodbymeend]]

Note, if you were running this from a header or footer in a beta
version of PmWik, you would need to add asterisk like this {*$Name} to 
make sure that the returned name is the name of the profile page being 
viewed, rather than the GroupHeader or footer that contains the pagelist.

You could probably also use the author page variable instead of {$Name} 
or {*$Name} for a pagelist that could be run from any page and would 
report pages last modified by the person viewing the page (but only if 
the author page variable has a value, i.e. the person is logged in or 
has recently saved a page and supplied the correct author name).

Pico

-- 

         __  /
        /   /
       /___/ _/  ___/  __  /
      /      /  /     /   /
    _/     _/  ____/ ____/

 >>>===pmwiki at ben-amotz.com===>




More information about the pmwiki-users mailing list