[pmwiki-users] pagelist bug?

Patrick R. Michaud pmichaud at pobox.com
Thu Nov 24 09:31:54 CST 2005

On Thu, Nov 24, 2005 at 02:18:03PM +0000, Hans wrote:
> To display page titles rather than names in the default format of
> pagelist (fmt=bygroup) one can set in config.php:
> $FPLByGroupIFmt = "<dd><a href='\$PageUrl'>\$Title</a></dd>\n";
> but the results are not consistent when (:pagelist :) lists pages from
> other groups via group=OtherGroup, i.e. the results are page names not
> titles.

The reason for this that by default PmWiki attempts to avoid 
unnecessary pagereads, so it uses title information from the page's
contents if it happens to have it cached and the pagename if it doesn't.
For a standard pagelist query that is being sorted by name, PmWiki
doesn't read each individual page in the list.  (more below)

> Also using order=time, or order=size and its negative forms will
> result in titles being shown, but order=name will show page names,
> even when using (:pagelist group={$Group} ... :).

Parameters such as order=time, order=size, etc. all mean that PmWiki 
has to do a pageread, and in the process of doing so it goes ahead
and caches the title information.  Using order=name will show titles
if PmWiki happens to have cached them -- see the example I added to
http://softflow.co.uk/design/Test2/PagelistTest.  And doing something
like order=name,size would also work.

My suggestion is that when changing the pagelist to display titles
instead of names, one should also change the default to order by
title instead of name:

    $FPLByGroupIFmt = "<dd><a href='\$PageUrl'>\$Title</a></dd>\n";
    $FPLByGroupOpt['order'] = 'title';

This will cause the titles to always be read, as well as sorting
the resulting list into title order which will make more sense
than having pages with titles mysteriously appear out of sequence
in the resulting list.

> ====
> Something else just bothered me when I set up these testpages:
> you can see at
> http://softflow.co.uk/design/TestGroup2/Test1
> that the {$FullName} on the page is displayed with a group name which
> looks like a "page yet to be created" link. 

I'm guessing this is because of a modification to the wikiword pattern
or some other interaction with wikiwords -- the site is somehow seeing
TestGroup2 as a wikiword and linking it + spacing it.  I'm not sure
why it's not catching the Test1, however, unless there's a change
in $WikiWordPattern that's causing it.


More information about the pmwiki-users mailing list