[pmwiki-users] Pagelist problems (pretty advanced)

Patrick R. Michaud pmichaud at pobox.com
Mon Oct 16 14:18:56 CDT 2006


On Mon, Oct 16, 2006 at 02:27:17PM -0400, Crisses wrote:
> 
> >>(:if name Category.Period-* :)
> >>(:pagelist link=Category.{$Name} group=Simile fmt=#periodcatlist
> >>list=normal order=$:Year,$:Work,$:WAuthor :)
> >>(:ifend:)
> >
> >Do you really want to be searching on the Simile group,
> >as opposed to the Data-Simile group?  In other words, which
> >group contains the pages with the "Year: ..." markups?
> 
> No -- the Category group links are not on the Data-Simile pages.  The  
> Category links are on the Simile/Page itself.  i.e. link=Category.X  
> will be on Simile.PageName  -- If I switch this to Data-Simile, the  
> category pages are all blank.
> 
> The pagelists should be taking care of all the data lookups.

Uh oh, I think we can't get there from here.

> So I need to grab the variables from Data-PageName for the order:
> 
> (:pagelist link=Category.{$Name} group=Simile fmt=#periodcatlist
> list=normal order={Data-{$BaseName}$:Year},{Data-{$BaseName}$:Work}, 
> {Data-{$BaseName}$:WAuthor} :)

Alas, this absolutely doesn't do what you're hoping it will do.
There's not a way to pass an argument to order= that says "I want
to sort based on values in pages other than the ones in the 
pagelist".

In the above, the {...$:Year} and other variable substitutions
occur _before_ the (:pagelist:) directive is processed.
So, what's happening is that {$BaseName} is receiving the basename
of the current page (as opposed to the basename of each page
in the pagelist), and the order= arguments are the year, work, 
and wauthor values from whatever Data- page corresponds to the
current page (i.e., the one displaying the pagelist).

I fear this is a huge design complication of FASTData,
in that it creates relationships between pages (e.g., Data-Simile/XYZ
and Simile/XYZ) that (:pagelist:) knows nothing about.  Personally,
I would've chosen to have the data go directly into the Simile
pages, rather than factoring them out to a different group.
Then everything would work much more naturally.

> It's the lower of the two pagelists on the page -- the top one is the  
> old format.  A definite improvement, but the dates aren't sorted  
> correctly.  How do you change the sort order?
> 1930
> 1939
> 1937
> 
> Is it descending?  Or just screwed up because it's all numeric?

Neither -- since the order= option isn't getting any valid sort
criteria, I'm not sure how it's being sorted.  Perhaps not at all.

This sort of capability -- to essentially perform the equivalent
of database joins, selects, and groupings -- is waaaaay outside
of the realm of what I had been envisioning for the PmWiki core.

Pm




More information about the pmwiki-users mailing list