[pmwiki-users] Skipping Edit and using Fox.

Mark Bacas mbacas at gmail.com
Mon Mar 1 21:42:25 CST 2010

Hi Hans,

Thanks for the information. I think I'm having a problem seeing the
forest for the trees. :)

I have done a lot of reading of the various form systems and how to
implement them.

I have been looking at your "Contact" system and trying to work
backwards from that.

I think the fundamental thing I was missing was to have a form and
create a page from there. Where I was trying to create a new page with
a blank form from a template with an embedded form.

I think I'm almost there, but I'm still not sure.

I think this might be throwing me off a little where it says it's
going to create a new page based on a template:

Example for creating serial pages with Fox

The following form will display just a button. When clicked the form
will create a new serial page in group ToDo using the Name part prefix
of Jack-, basing the new page on a template page Site.ToDoTemplate.
The user will be redirected to the new page.

(:fox newtodo template=Site.ToDoTemplate redirect=1:)
(:input hidden target '{$$(serialname ToDo Jack- )}':)
(:input submit post "Create New ToDo Page":)
(:foxend newtodo:)

Note that the serialname expression is enclosed in hyphens, and that
it is used here as a replacement variable {$$(serialname ...)} and not
as a normal markup expression {(serialname ....)}. Normally markup
expressions will be evaluated when the page is loaded, whereas the
expression written as a replacement variable will only be evaluated
when the form is processed, thereby overcoming possible conflicts of
page names if another user is creating a page at about the same time.

I want to setup a GTD (task list/project management) system. I have a
very good start with a "dashboard" page that has all the information
listed as I want using various pagelists (below).

However, perhaps you could advise me in the best way to get the form
side of things going.

I want to create a form/template that creates a new page for each
entry using the "newticket" function of powertools. So I'm guessing
that needs to start something like:

(:fox newgtd template=Template.GTDTemplate redirect=1:)
(:input hidden target '{$$(newticket)}':)

Instead of having this ("'''New Entry: '''[[{(newticket GTD)}]]") on
my dashboard page I'd like to have a button that I click that takes me
to a form that I fill out that when submitted creates a page something
like GTD.20100301003, and takes me to that page with the exact same
form I filled out with the information in place or maybe take me back
to my dashboard page where the information may or may not be displayed
depending on pagelist criteria. (Well it will be in one list where I
just show all GTD pages at the bottom).

So some actual questions:
1. Should I create something like GTD/NewGTD like you have for "NewContact"?

2. Something like this in the template (appears to work for the
newticket process:
(:fox contactform target='{$$(newticket)}' put=top ptvupdate=1
template=ContactTemplates#new redirect=1:)
(:input defaults source={$EditSource} :)

3. Is there an easy way to have the new page use the same form as the
"NewGTD" template?

The fields I want to have in my form are:
Start Date,
Due Date,
Completion Date,
Status (which will have a predefined selections of "open, closed,
active, suspended, closed" and perhaps there's a good way to handle
Type (here I'm using "next" or "project", but maybe other stuff in the future),

Also, from my dashboard, I'd like to be able to click on the page and
bring up and edit the form, but I think that will work fine.

Actually after typing all this I think I may be able to get what I'm
looking for. Going to go and mess with the "Contacts" system a little


'''New Entry: '''[[{(newticket GTD)}]]

%purple%'''Open Developer Support Issues'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:context=dev,

%green%'''Open Partner Portal Issues'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,
$:status=-closed, $:context=partner:)

%navy%'''Open Developer Portal Issues'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,
$:status=-closed, $:context=devport:)

%red%'''Open ECRs'''
(:pagelist fmt=#GTDlist order=$:ID
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,
$:status=-closed, $:context=ecr:)

%maroon%'''Open Catalog and Price List Issues'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,
$:status=-closed, $:context=catalog:)

'''Pending Status Entries'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=pending:)

'''Open Status Entries - Oldest First'''
(:pagelist fmt=#GTDlist order=name
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,

'''Closed Status Entries'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=-open,

'''Archives:''' [[2010-02]]

[[InBox]]  |  [[Projects]]  |  [[NextActions]]  |  [[Context]]

(:refresh 300:)

Below is from my Site/LocalTemplate used in the page above.
(:if equal {<$Group}:)
(:table class=jlist align=center width="98%" :)
(:cell style="background:#e5e5ff;padding-left:5px" :)'''Entry'''&nbsp;
(:cell style="background:#e5e5ff;padding-left:5px" :)'''Summary'''&nbsp;
(:cell style="background:#e5e5ff;padding-left:5px" :)'''Status'''&nbsp;
(:cell style="background:#e5e5ff;padding-left:5px" :)'''Type'''&nbsp;
(:cell style="background:#e5e5ff;padding-left:5px" :)'''ID'''&nbsp;(:if:)
(:cellnr style="background:#eeeeff;padding-left:5px"
(:cell style="background:#eeeeff;padding-left:5px"
(:cell style="background:#eeeeff;padding-left:5px"
(:cell style="background:#eeeeff;padding-left:5px" :){{=$FullName}$:type}&nbsp;
(:cell style="background:#eeeeff;padding-left:5px" :){{=$FullName}$:ID}&nbsp;
(:if equal {>$Group}:)

Thanks again Hans,

 - Mark

Perhaps when I've got things figured out I'll write up a cookbook.

On Mon, Mar 1, 2010 at 5:42 PM, Hans <design5 at softflow.co.uk> wrote:
> Mark, I recreated the Journal.Journal page and the Journal.Template
> page.
> Clicking the link takes me to page Journal.20100301001 in noraml edit
> mode. No tempate is inserted into the edit window.
> I guess you have set somewhere that new pages should use the
> template? Still, clicking  a link to a non-existin gpage will always
> put you in standard edit mode, with or without a template inserted.
> It won't be saved automatically.
> Now if I click the submit button of the Fox form, page Journal.20100301001
> is created (saved) with the template as content, i.e. that form.
> I don't see an issue there.
> What is totally unclear to me is the purpose of that form getting
> saved into the new journal page. That is not a Fox form, even though
> you use #foxbegin# and #foxend# in the template. In Fox context, those
> two are markers which foxdelete can use to delete a range (several
> lines). When Fox posts a template with those markers, they will be
> converted into markers which carry an id stamp.
> In fact the form is dead, and submit does nothing.
> If it would be me i would put a Fox form into the GroupFooter or
> GroupHeader to add the journal content, posting to the current page,
> which will get created with a simple Fox form using the newticket and
> adding some standard content perhaps. Or have the full journal content
> form on your index page, posting to target newticket.
> I can see one issue with the Fox form on the Journal page: if you use
> redirect, then (:foxmessages:) will never get a chance to show errors
> or feedback. But it is finew there for debuging, when you turn off
> redirect.
> hope this helps a bit!
>  ~Hans

More information about the pmwiki-users mailing list