[pmwiki-users] Modifying Wikiforms

John Rankin john.rankin at affinity.co.nz
Wed Feb 1 17:18:24 CST 2006


On Thursday, 2 February 2006 10:56 AM, Tegan Dowling <tmdowling at gmail.com> wrote:
<snip>
>1. Retain the page numbering scheme, but use a (:title Textual Name:)
>   directive on each page.
>
><snip>
>
>2. Modify wikiforms to work off regular page names as well as the
>   all numeric pattern.
>
><snip>
>
>So I tend to favour option 1. It would need to support sorts by
>title instead of name, but that is straightforward.
>
> Regarding option 2: When you say
>"Both the form handler and list handler will run into trouble
>if they try to process pages that don't follow the template."
>
> What kind of trouble?  If they fail in the PmWiki way, by just
>returning nothing, then that might not be such a big deal...
>While I was poking around in it, I wondered if the new, more
>feature-full pagelist might work for identifying and selecting
>pages with names.  An admin could create a custom "list=" that
>excludes pages that aren't wanted.

At the moment, the code is quite basic -- it assumes that if
the page name fits the numeric pattern, the contents follow
the form template. At a minimum, what it would have to do
is check that a page starts with ":First prompt string:" and
omit any that don't. It would need to do this when generating
a list, editing a page and deciding whether a page gets an
"Edit Form" link. We will also need a new mechanism for
assigning names to new pages.

This should all be do-able, but it will require careful testing.
It's a big step up in functionality from what's there now. I just
don't want to start until I understand all the issues and have a
way to deal with them.

The new pagelist may well help here -- I am afraid I have
fallen rather behind on what this can do. However, an
admin-maintained list of excluded pages may not be
very robust. I fill in a form, enter [[another page link]],
save, click the '?' and now there is a new page in the group
that doesn't use the form template. This is an entirely
reasonable thing for an author to do, of course.
>
> Regarding option 1: would the user provide the page title, as
>part of filling in the form?

I see a range of possible approaches:

a) a minimalist approach would have the author specify
    (:title Some Title Text:) anywhere in the form and pmwiki
    will "just work" -- all wikiforms has to do is handle titles
    in the Page column of wikilists

b) like (a), but we add a title field type -- the author enters
    Some Title Text into the form field and wikiforms wraps
    (:title :) around it; this could potentially omit the
    :Page Title:  when rendering the page

c) like (b), but we allow the template designer to specify how
    to generate a (:title:) from other field(s), taking advantage
    of the hide field type
>
> And in either case, will you be able to support allowing
>formatting of the form page, (or pulling field contents into a
>formattable page) for viewing?

I think the most flexible approach is to allow pulling field
contents into a formattable page, then you can have as many
views of the data as you like. The directive
    (fpara fieldname=pagenumber:) 
is a baby step down this road -- it returns the value of 
fieldname from pagenumber.

For example, we might have a DisplayTemplate, the mirror
of a FormTemplate, that controls how a page's contents are
displayed. After all, this is what editing a page with a form 
does -- extract the data and present it through form. A
DisplayTemplate might contain (this is just an illustation)

(:field dateraised:)

Dear (:field firstname:)

(:field complaint:)

Currently, this is (:field status:).

When are you going to do something about this?



Then Group.PageName?action=view&template=DisplayTemplate
Something like that, anyway...

John

-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list