[pmwiki-users] pagelist question: more info in $matches?

Patrick R. Michaud pmichaud at pobox.com
Tue Oct 3 17:27:58 CDT 2006


On Tue, Oct 03, 2006 at 04:26:47PM -0500, Ben Stallings wrote:
> 1) Am I mistaken here?  Is there a way for custom page variables to be 
> included in the information FmtPageList plugs into the template?  (If 
> so, I could focus my attention on fooling MakePageList into thinking the 
> database record set is a group of pages, which would be really slick.)

I'm not sure I understand the question, but I think you're mistaken.

In general FPLTemplate doesn't need to directly know the values
of any page variables, because it uses calls to PageVar() and
MarkupToHTML() to handle any page variables that arise.   (The
exception is the {$$option} variables, which FPLTemplate handles
directly.)

My guess at what you want to do is the following:

1.  Create a custom PageStore object that converts database records
into (virtual) pages.  In other words, when some function calls
ReadPage('DataBase.RecordId'), the custom PageStore object should
return the equivalent of a page where $page['text'] is:

    (:Field1:Value:)
    (:Field2:Value:)
    (:Field3:Value:)

Once you have that, then (:pagelist:) should be able to do a
variety of searches and sorts based on the records in the database,
and use custom pagelist templates for the output.  (Hint:  the
PageStore object will need to implement the read(), ls(), and 
exists() methods.)

2.  Come up with a good set of options to enable smarter (SQL-like)
queries against the database and return the record identifiers (as
pagenames) back to (:pagelist:).  This would be done with a
custom $PageListFilter[] function.  Then someone would be able to
do an SQL-like query to get the set of records to be displayed, but
be able to display them using the pagelist template functions.

Pm




More information about the pmwiki-users mailing list