I figured it out (i.e., putting data from a FreeForm web form into a weblog—no photos/files, sorry!—with custom fields parsed properly). So for anyone who’s wondering, here’s how I did it. (I’m not paid by EllisLabs, so this ‘tutorial’ might be a bit light).
You’ve got your custom fields (mine are witness, witnessemail, offensesite, and thatoffends). ALL OF THESE FIELDS have to be set as textareas (in “Field Type” under CP > Weblog Admin > Custom Fields > Field Groups)—see here for documented proof; it’s in a red box! The good news is, FreeForm can display text inputs to the user to get the data.
So this is my moblog template. It requires authorization; hence the first line. Also (as a newbie this confused me), the FreeForm email template has to be different: IN THE MOBLOG TEMPLATE, the data is represented by “{text}” between the field tags. Not so in the other template.
AUTH:{username}:{password}
{field:witness format="none"}{text}{/field:witnessemail}
{field:witnessemail format="none"}{text}{/field:witnessemail}
{entry_title}{title}{/entry_title}
{field:offensesite format="none"}{text}{/field:offensesite}
{field:thatoffends format="xhtml"}{text}{/field:thatoffends}
Now, if you’ve installed FreeForm from Solspace, you can set up an email template (CP Home > Modules > Freeform > Manage Templates). Whereas the previous template tells EE how to interpret the email to the moblog address, this template tells the form how to send data in a way that EE can interpret. My FreeForm template looks like this:
AUTH:{username}:{password}
{field:witness format="none"}{author}{/field:witness}
{field:witnessemail format="none"}{email}{/field:witnessemail}
{entry_title}{title}{/entry_title}
{field:offensesite format="none"}{offensesite}{/field:offensesite}
{field:thatoffends format="xhtml"}{body}{/field:thatoffends}
NB: it looks similar to the other, but it’s different. The field tags are identical, but between them, it no longer says {text}. Instead, it says {author}, {email}, {body}. It doesn’t really matter what these say. These are the names of the FreeForm form fields.
My FreeForm form looks like this:
<!-- form_name corresponds to my FreeForm settings, required forces users to fill in all (and check the
checkbox -- incidentally forcing the user to check the box was the reason I started on this moblog quest
in the first place), template refers to the FreeForm template I showed above -->
{exp:freeform:form form_name="tom_moblog" required="password|title|offensesite|body|agreeToTerms"
notify="my_moblog_address@my_domain.com" template="tom_mob_template" form_id="tom_form"}
<!-- These are hidden, but EE fills in their values -->
<input type="hidden" name="author" value="{screen_name}" size="25" />
<input type="hidden" name="email" value="{email}" size="25" />
<!-- Unfortunately, you need to get the user to re-enter his/her pw, which is a pain for him/her,
and it may lead to questions about who can see his/her pw -->
<p class="small">* Please confirm your PSNP password<br />
<input type="password" name="password" class="required" size="25" />
<input type="hidden" name="username" value="{username}" /></p>
<!-- NOTE that the name="..." tag corresponds to WHAT GOES BETWEEN THE FIELD TAGS in the FreeForm email
template. name="author" because '{field:witness format="none"}{author}{/field:witness}', and name="email"
(NOT name="witnessemail") because '{field:witnessemail format="none"}{email}{/field:witnessemail}' -->
<p class="small">* Short descriptor<br />
<input type="text" name="title" class="required" value="" maxlength="128" class="input" size="25" /></p>
<p class="small">* Site of offense<br />
<input type="text" name="offensesite" value="" maxlength="128" class="required" size="25" /></p>
<p class="small">* Offense<br />
<textarea name="body" cols="23" rows="3" class="required" tabindex="4"></textarea></p>
<p class="small"><input type="checkbox" name="agreeToTerms" value="agreeToTerms" class="required" tabindex="6" />
I agree to the <a href="{path=">Terms and Conditions</a> of the site.</p>
<p class="small"><input type="submit" name="submit" class="submit" value="Submit" tabindex="7" />
{/exp:freeform:form}
All the visible form elements have class=“required” because I use javascript to validate the form fields’ contents, using this nifty tool (and advice for implementing it in EE here)—the styling can still be accomplished with id=”“, and without this js there’s no need for class=“required” or for the form_id parameter in the FreeForm tag. It is not necessary for the moblog/FreeForm integration.
There you have it. User enters data into FreeForm. FreeForm formats it and emails it to my moblog address. EE checks the moblog address for emails with the username and password at the top, and parses the form data into the correct custom fields.
Magic! Tedious, time-consuming magic! Hopefully it’ll be less tedious for you readers.