[pmwiki-users] Recursive pagelist?
pbowers at pobox.com
Wed Mar 21 15:19:49 CDT 2012
On Wed, Mar 21, 2012 at 8:06 PM, Lars Eighner <surname at larseighner.com> wrote:
> I would like to page list my Category group to descend a couple of levels so
> that the output looks like the example in Pmwiki.Categories under "Category
> nesting." (I assume the example was typed to illustrate the point of
> hierarchy and was not generated.)
> This looks like at least three or four days hard work for me as
> scripts/pagelist.php is not altogether a model of clarity, but I'd really
> like to avoid reinventing the wheel if something that will do this exists.
You might want to take a look at
http://www.pmwiki.org/wiki/Cookbook/GraphVizSitemap -- it has roughly
analagous functionality with the recursion and etc. However, it is
not making use of .pageindex and thus the performance is pretty bad --
basically it is an exhaustive traversal of every page in your site.
If you are prepared to rely on the .pageindex fully then I believe the
whole thing could be done via a single scan through that file.
However, the beauty of pagelists (or one of them) is how robustly it
treats the index -- it makes full use of .pageindex whenever it exists
and is up-to-date for a page but if the index is not generated for a
given page there is no problem... To replicate this robustness would
not be trivial.
There's an implementation idea bouncing around in the back of my head
that the whole thing could be done with existing pagelist
functionality. You just have to put additional pagelists within your
custom template within conditionals that check if you are dealing with
a Category page. But once again performance is going to be your big
problem unless you're dealing with a pretty limited number of pages.
More information about the pmwiki-users