Recent Changes · Search:

Support the Project

Wikipublisher

PmWiki

edit SideBar

 

Search: Turn search results into a printed report

How can we use pagelist directives to create a flexible typeset-on-demand service?


Calligraphy from the 8th and 9th century

PmWiki’s pagelist directive is a powerful and flexible search system. One of the things we sometimes want to do is let a reader turn selected search results into a typeset report. Wikipublisher includes a special format option to do this, shown in Publish selected search results.

Publish selected search results

(:pagelist citation group={$Group} list=normal fmt=custom :)
TipOfTheWeek
00007
00008
00009
00041
  PDF    

The first part of the directive is standard pagelist options: look for “citation” on pages in the current group, omitting the usual suspects like the Recent Changes page. The final option, fmt=custom, tells pagelist to use the special “custom” format included with Wikipublisher. This turns the output into a form, with a checkbox against each page found that meets the search criteria. In the PDF view of the page, in place of the form the results list reverts to the default definition list format.

The PDF version is currently formatted using the “report” template, which produces a fair bit of nice looking, but uninteresting, front matter before the actual content. A good case can be made that printed search results would be more useful if presented using the “article” template, which omits the cover pages and cuts straight to the chase. Perhaps this could become a configuration option in a future release.

The form feature uses PmWiki’s now-deprecated transitional “fplbygroup” function, rather than the preferred template and markup-based approach described in Page Lists. This is because the code pre-dates the template feature and we haven’t yet worked out how to:

  1. set up a template to produce a suitable HTML form as output
  2. use a different template when producing a PDF or
  3. translate PmWiki’s form markup into a PDF form

This is left as an exercise for the interested reader.

Category: navigation aid

« 00042 · Edit Form · 00044 »

Creative Commons License
Edit · History · Print · Recent Changes · Search · Links
Page last modified on 16 August 2008 at 05:17 PM