[pmwiki-users] PmWiki and Pagelist as report generator
Peter & Melodye Bowers
pbowers at pobox.com
Thu Aug 21 10:51:48 CDT 2008
> Producing the individual pages manually using the ordinary pmwiki editor
> was fine when there were only two or three a week. However, we're going
> to need lots more, and it would be useful to use an input form to write
> out the individual pages.
>
> Is there a way in PmWiki of having a form that collects values of
> variables and then writes them out, not to an email, but to a new wiki
> page whose name is constructed from variables in the form?
I'll probably later move this solution to Cookbook/WikiShExamples, but for
now there is a working prototype (purely test data - feel free to punch it
around) at
http://www.qdk.org/pmwiki/pmwiki.php?n=WikiShForms.2008-08-21-something
(I don't usually leave them as "live" examples -- I thought this one was
particularly cute as an example of a very simple flat-file (non-relational)
database that could be really functional and is very extensible in terms of
validations and etc...)
>From there you can edit and save the PTV values or create new pages using
the supplied field/button. Each page kinda-sorta contains its own
"make-me-into-a-form" code so when you view the page it will view it in a
user-friendly form interface even though the page itself is basically just
data with a 1-line WikiSh function call. You can still go to action=edit or
action=source to see the (now hidden) PTVs that it's based off of.
I followed your PTV names and etc just for consistency, but I only did a
subset of them. Adding the rest is just a typing exercise...
If you are looking at the solution you will also be interested in these
pages:
* WikiShForms.Template - the content that is copied into place when a new
page is created (all it does is (:include PageContent:)
* WikiShForms.PageContent - the actual content of the page that gets pulled
in -- just a function call now, but you could add something else on this
page and all "data" pages would automatically "be updated" with the "new
look"
* WikiSh.WikiShForms-GroupRC - the location of the function definition
(active for this group but nowhere else)
There's all kinds of capabilities for validating the data in the form as
well. I haven't done anything like that because I don't know what your
requirements are...
I didn't do anything with the pagelist reports because it seemed like you
already had that going well and just needed the form solution, right?
Hope that helps!
-Peter
PS Whether you use this solution or not, I strongly recommend taking a look
at the use of (:include {$Group}.PageContent:) to bring in your view-table
from one master copy rather than having it hard-coded on each individual
page. (Maybe you're already doing this and just didn't mention it in your
email - if so, ignore this paragraph.) Otherwise at some inevitable point
in the future someone is going to have the unenviable task of going through
and hand-editing a bunch of pages in order to allow for an additional field
or a change in a label or something like that... Just a tho't.
More information about the pmwiki-users
mailing list