FormTemplateProcessor by Ryan Cramer

Proof-of-concept module to let you use templates as web contact forms. Can send you email and/or save the submission to a page in your site. Intended to be a starting point and proof-of-concept, so you may want to take this further.

ProcessWire FormTemplateProcessor module

Overview:
=========

Module to let you use templates as web contact forms.
Can send you email and/or save the submission to a page in your site.
Intended to be a starting point and proof-of-concept, so you may
want to take this further.

For more information:
http://processwire.com/talk/index.php/topic,75.0.html

Designed for use with ProcessWire 2.0 or 2.1
http://processwire.com

Installation:
=============

1. Place FormTemplateProcessor.module in your site/modules/ directory.
2. Login to ProcessWire admin and click to Modules.
3. Click "Check for new modules".
4. Click "install" next to the new FormTemplateProcessor module.

Usage:
======

1. In admin, create the fields you want to be part of the form.
2. Create a new template and assign your fields to this template.
3. Create another template for your contact form page (if you don't already have one).
4. Use the example below as a starting point for this contact form page:

$form = $modules->get('FormTemplateProcessor');
$form->template = $templates->get('my_contact_form_template'); // required
$form->requiredFields = array('fullname', 'email');
$form->email = 'your@email.com'; // optional, sends form as email
$form->parent = $page; // optional, saves form as page
echo $form->render(); // draw form or process submitted form

5. Use CSS to style the fields. See below for a suggested starting point:

.Inputfields,
.Inputfields li {
list-style: none;
margin: 1em 0;
padding: 0;
}

.Inputfields li label {
font-weight: bold;
}

.Inputfields li p {
margin: 0;
}

.Inputfields li p.description {
font-style: italic;
}

.Inputfields textarea,
.Inputfields .InputfieldMaxWidth {
width: 100%;
}

.Inputfields .InputfieldSubmit label {
display: none;
}

.ui-state-error-text {
color: red;
}



Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #519
    In the 519th issue of ProcessWire Weekly we'll check out a new third party module called RockForms, introduce the latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 20 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits