00756: WikiForms setup for dummies

Summary: WikiForms setup for dummies
Created: 2006-06-13 06:03
Status: Closed
Category: Cookbook
From: Kersti
Assigned:
Priority: 4
Version: 2.1.5
OS:

Description: Trying to set up wikiforms and having a world of hurt with it. I'm generally pretty good at following instructions and sorting things out, but the instruction set for this one is hideous.

So, could someone please send me a list of instructions - written for a complete imbecile, along these lines:

  1. download the scripts wikiform.php and wikiform-i18n-en.php
  2. copy them to the cookbook/ directory.
  3. add the following line to your local/config.php file:
    include_once("cookbook/wikiform.php");
  1. download and install the MarkupExtensions
  2. download the WikiFormCSS.php script
  3. put it in your local/ directory

(This, incidently, is as far as I've successfully gotten so far... now what pages do I create and what should be on them. The cookbook page is full of options - but give me the basic setup first! I'm getting soooo frustrated here!)

I don't want anything fancy - just something like the sample given at http://intranet.affinity.co.nz/pmwiki2/index.php?n=Issues.Issues (this link is broken. - should i delete it? - leo)


I agree with you - it's a confusing one to set up. I'm not sure that I can give you a complete (ordered) list of instructions, but I thought I'd document what I did. I do not have this in production at this time, but my testing shows that the process indeed works. Scott Connard

I have the following in my config.php:

# for WikiForm
$FormNavFooter = false;
$WikiFormSubmit = 'post';
include_once("$FarmD/cookbook/wikiform.php");
$NewGlossaryPage = 'Forms.Add';
include_once("$FarmD/cookbook/formtitle.php");

The formtitle.php thing is optional and even more confusing than the rest, but it does work. Obviously you have to download that module and stuff it in your cookbook directory with the others. If you aren't using a wiki farm, you can omit the "$FarmD".

I created a new group called "Forms" and created a few pages:

Forms.FormTemplate

My version of this was taken from the sample in the cookbook and modified to try to include one control of each type.

:Title:title (title) +

:Fields:fields (3*15)

:Author:author (*author) +

:Email:email (email)

:Date:date (*date) +

:Text:text (text)

:Text3:text3 (text=3*20)

:Buttons:buttons help text? (1|1 - low;2;*3;4;5|5 - high)

:Popup:popup (Open, Confirmed, Active, Suspended, Closed) +

:Checkbox:checkbox (*check)

:Checkboxvalue:checkboxvalue (*check checkedValue)

:Check3:check3 help3 (*1:*2:3)

Forms.Forms

My homepage for the Forms group is simple. It has a link to a page which allows you to add a new form and it shows you existing forms. I am currently testing the formtitle.php module after the form list.

!!! [[Add | Add a new form]]

!!! Existing Forms

(:wikilist page=form:)

(:linebreaks:)
[[?title for #7]]
[[?title8]]
[[?title9]]

Forms.Add

I created a page for adding a new form. I guess you could do this on the Forms homepage, but I wanted it separate. This is the page that actually shows the form and allows you to enter data. When the Submit button is clicked, the data is submitted and the new Forms.00001 page (or whichever number is next) is created. I use the $WikiFormSubmit = 'post'; option in my config.php to not have the data page come up in edit mode because I thought that was confusing.

(:wikiform:)

Forms.ViewTemplate

Without a Forms.ViewTemplate file, the data page is pretty ugly - editting the page brings back the nice form, but just viewing the data is ugly. This Forms.ViewTemplate page can be used for viewing form data in a prettier format, with additional text, etc. My example is almost as ugly as the normal template, but the point is you CAN change it to suit your needs. The Forms.ViewTemplate is optional.

The ViewTemplate also allows you to add other items like an attachment mechanism - as documented in the cookbook, you would submit the form first, which creates a wiki page, then you upload a file for the newly created page. My test ViewTemplate has an attach in it.

(:linebreaks:)

This is what the form looks like:

Title = <title>
Fields:
-><fields>
Author = <author>
Email = <email>
Date = <date>
Text:
->[=<text>=]
Text3:
->[=<text3>=]
Buttons = <buttons>
Popup = <popup>
Checkbox = <checkbox>
Checkboxvalue = <checkboxvalue>
Check3 = <check3>

(:if ! attachments:)
[[{$FullName}?action=upload | Upload the document]]
(:if attachments:)
(:attachlist name={$FullName}:)
(:ifend:)

I was just testing the basic mechanism and did not get into the scoring and some of the other options. If you have any questions or you realize that I've left out major portions of my implementation, let me know and I'll add some more to this. Scott Connard


Brilliant! Thank-you so much! I now have it all working and being used by my team. Kersti