[pmwiki-devel] Templates and value arrays

Kathryn Andersen kat_lists at katspace.homelinux.org
Tue Jul 22 21:28:48 CDT 2008

On Tue, Jul 22, 2008 at 09:52:04PM -0400, DaveG wrote:
> To be honest, I'm not understanding the approach you're suggesting. I 
> have some questions to specific parts of your reply below, but perhaps 
> I'll try to summarize what I think you might mean.
> 1] Create a page store, with page templates for albums and photographs.
> 2] Continue to use GroupFooter to contain the cookbook markup.
> 3] Inside the markup function, read in the pagestore template.
> 4] Use regex to replace $xxx variables with actual values in the template.
> 5] From the markup return the replaced template text -- thus generating 
> the 'virtual page' for the reader.

I wouldn't approach it quite this way.

1] Create a page store
a) set aside a Group for this page store (e.g. "Album")
b) In local/Album.php, initialize the special page store.
c) as part of the parameters for the initialization of the page store,
   give the information about the source of the data (where you are
   looking for the album information)
d) each "virtual" page contains the information about ONE photograph;
   the page-name gives enough information to be able to look up the
   data about that photograph, and the content of that virtual page
   will consist of hidden page-text-variables, for example:

(:Name:photograph name:)
(:Caption:this is the caption:)

2] Use Album.GroupFooter as a template for displaying photographs.
For example:

(:if name -{$DefaultName},-{$Group}) (:comment not the group index page:)


This approach doesn't actually rely on special markup in the GroupFooter
to trigger the page store at all; it just uses PmWiki's powerful
page-text-variable feature to make templating easy.

With information about individual photographs in separate pages,
one can then use pagelists to display information about *collections*
of photographs.

Kathryn Andersen
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe

More information about the pmwiki-devel mailing list