DataSections

Summary: Create formated lists of PTVs stored between anchor blocks on another page.
Version: 2007-12-03
Prerequisites: none
Status: alpha
Maintainer: Ausimage
Discussion: DataSections-Talk
Categories: Includes,Layout

Questions answered by this recipe

It allows the author create a page of formated values from a page that has multiple same-name sections and same-name PTVs.

Description

Create formated lists of PTVs stored between anchor blocks on another page.

Notes

Install

Place the Data SectionΔ in your cookbook directory and then place include("cookbook/DataSection-0.5.php") in your config file.

Wiki Markup

The current markup for Data SectionΔ tries to stay true to standard PMWiki markup. Each section is contained in anchor block and does not change over each section to be listed. Each value in the section is a standard PTV assignment (definition list or hidden data format) that is reused inside each section.

[[#entry]]
item: soup

(:cost: $2.00:)

heals: everything

[[#entryend]]
[[#entry]]
(:item: orange:)

(:cost: $1.00:)

heals: cold and flu

[[#entryend]]
[[#entry]]
item: garlic

(:cost: $.50:)

(:heals: immunity:)

[[#entryend]]

Each section is then parsed with a template page to create the final listing of sections with this directive.

(:listblocks pg=group.page[#section] fmt:group.page[#section] [if="equal {=$name} value:\)

Some value assignements can be stated within the configuration. For details examine the source file. pg has a default value of #entry. If fmt does not specify a section then the whole page will be used. An optional if clause could be added to filter on PTV values found within each section.

Sample Block Template

Our {=$item} can help with your {=$heals} and it only costs {=$cost}.\\

Sample Output

Our soup can help with your everything and it only costs $2.00.
Our orange can help with your cold and flu and it only costs $1.00.
Our garlic can help with your immunity and it only costs $.50.

Release Notes

This a first release. It has the basic functions I was thinking of including. I hope to improve the recipe by including additional features of page lists and by improving its overall usability.

See Also

Contributors

Ausimage

Comments

See discussion at DataSections-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.