This is the old wiki of the FFII, which is now read-only, for reference. See here for more information.


FAQ

Understanding the HTML templates

Q

The HTML file netstrike.en.html contains a cryptic line:

A

This is just basic templating stuff. The HTML::Template module takes care of this. Read its documentation to understand, how variables are inserted into the HTML. In "eintrag", the line that corresponds to the FORM action above is:

Nothing special here - just a way of avoiding to hard-code the form action (so that eintrag can run under any name you like). Just leave it untouched in all the forms.

Testing new forms

Q

I'd like to play with the Aktiv page "netstrike". Therefore, I created a copy with the name "netstrikeqqq". However, so far I wasn't able to access this copy using Aktiv. What's the best strategy for testing new pages? Should I test them on my local system (I try to avoid that)? If so, what files do I need?

A

I think for now, making your own copy of "eintrag" (e.g. eintrag_peter) is the best way to test.

Since a form w/o a corresponding form handler doesn't work, your new form will fail initially. Each new form must have its handler (corresponding by name) in the eintrag code or it will throw an error like the one you got. You'll find the form handlers in the code section beginning with:


CGI MAIN SWITCH


The handler for a newly added form called "netstrike" looks like this in the code:

This is the part that brings up an un-filled form:

This is the part that verifies filled-in form data (until the data passes its associated checks - implemented via Data::FormValidator) and subsequently saves it via Knecht:

For form validation to work, you still need appropriate validation data - in the eintrag code look for this data structure:

How you can avoid to unnecessarily create new form handler code:

If you plan to modify and test existing forms (rather than creating new forms), do the following:

Take the live template tree at

and create a copy of it in a directory of your own in e.g.:

Rename eintrag_peter to eintrag_peter.b (b for beta mode) and modifiy the line of code containing "/var/www/ffii/verein/spende/newdb/mcbeta" to read "/var/www/ffii/verein/spende/newdb/mcpeter"

Now it will be using the templates in YOUR tree instead of those in the live tree. It will also identify as a beta version on all forms in order to avoid confusion. This way you modifiy and test your own copy of the templates and you won't have to create any new form handler code unless you create new forms.

Form Validation

Q

In AKTIV it doesn't seem to be possible to remove Text entries. For example, for testing purposes, I entered the text "NA" into the field "Company or Organization" in the form "Your Coordinates". This worked fine. However, I cannot remove the entry anymore. The same problem applies to people that want to remove web sites from the Web-Campaign (Netstrike) interface.

A

this is just a matter of the validation setup found in this data structure

Any fields that you allow with length zero will accept "empty" input.

AktivDeveloperFAQ (last modified 2007-04-05 21:33:20)

Hosting sponsored by Netgate and init7