[pmwiki-users] pagelist questions

Bronwyn Boltwood arndis at gmail.com
Thu Jul 21 02:22:33 CDT 2005


On 20 Jul 2005 11:41:34 +1200, John Rankin <john.rankin at affinity.co.nz> wrote:
> On Wednesday, 20 July 2005 7:08 AM, Bronwyn Boltwood <arndis at gmail.com> wrote:
> >On 19 Jul 2005 13:14:36 +1200, John Rankin <john.rankin at affinity.co.nz> wrote:
> >> Try this in your config.php file:
> >>         $FPLByGroupStartFmt = "<div class='fplbygroup'><ul>";
> >>         $FPLByGroupGFmt = "</ul><h1><a href='\$ScriptUrl/\$Group'>\$Group</a></h1><ul>";
> >>         $FPLByGroupIFmt = "<li><a href='\$PageUrl'>\$Title</a></li>";
> >>         $FPLByGroupEndFmt = "</ul></div>";
> >>
> >> There may be a way to avoid the empty <ul></ul> that this
> >creates at the beginning, but I can't think of one.
> >
> >$FPLByGroupStartFmt = "";
> >$FPLByGroupGFmt = "<h1><a
> >href='\$ScriptUrl/\$Group'>\$Group</a></h1><ul class='fplbygroup'>";
> >$FPLByGroupIFmt = "<li><a href='\$PageUrl'>\$Title</a></li>";
> >$FPLByGroupEndFmt = "</ul>";
> 
> Right, because you are only outputting one group at a time, so there
> is only one unordered list in the output. However, what happens if
> you do a regular search and output multiple groups? IIRC, the normal
> search output uses the $FPLByGroup...Fmt variables.

Yep, it messes up with more than one group.  Hadn't tested that before.

I ended up with something partway between yours and Hans' answers,
plus some customization:

* wraps the whole output of the pagelist directive in a div tag
* starts each group with a whitespace paragraph, an H1, and then opens
the bulleted list
* closes each UL properly (AFAIK)
* declares class='fplsidebar' for the div and ULs
* leaves the built-in bygroup pagelist format available
* can have group headings turned off
* uses long page (:titles:)

And it looks exactly like the results of the typical by-hand sidebar
lists, except that it's entirely automatic.  Nice.  I've put it in the
cookbook, at http://pmwiki.org/wiki/Cookbook/Sidebar-stylePageList.

Thanks to you both!
Bronwyn




More information about the pmwiki-users mailing list