Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,090 of 9,090 pages
About the help in other languages
All help pages

Forms in templates

Forms on a public site built from content: information collection (feedback and contact forms) with ActionCollectInformation, the collect templates, validation messages, the result page and mail templates, the form…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/forms-in-templates.md

On this page

Forms in templates

This page is for designers who build contact and feedback forms. In Exponential a form is usually content: a class with fields marked as information collectors. Editors create the form as a page; the design draws it.

Contents

  1. How a feedback form works
  2. The form template
  3. After submitting
  4. Security
  5. Accessibility

How a feedback form works

  1. The full view of the form object prints a <form> that posts to /content/action.
  2. Each collector field is drawn with attribute_view_gui, which uses content/datatype/collect/ and prints an input.
  3. The submit button is named ActionCollectInformation.
  4. The kernel validates, stores the answers and shows a result page (content/collectedinfo/<class>.tpl) and can mail them (content/collectedinfomail/<class>.tpl).

The form template

{* override/templates/full/feedback_form.tpl *}
<h1>{$node.name|wash}</h1>
{include uri='design:content/collectedinfo_validation.tpl' class='message-warning' validation=$validation collection_attributes=$collection_attributes}
<form method="post" action={'content/action'|ezurl}>
    {foreach $node.data_map as $field}
        {if $field.contentclass_attribute.is_information_collector}
            <div class="form-field">
                <label for="ezcoa-{$field.contentclassattribute_id}_{$field.contentclass_attribute_identifier}">{$field.contentclass_attribute.name|wash}</label>
                {attribute_view_gui attribute=$field}
            </div>
        {/if}
    {/foreach}
    <input type="hidden" name="ContentNodeID" value="{$node.node_id}">
    <input type="hidden" name="ContentObjectID" value="{$node.contentobject_id}">
    <input type="hidden" name="ViewMode" value="full">
    <button type="submit" name="ActionCollectInformation">{'Send'|i18n( 'design/mytheme/form' )}</button>
</form>

Compare with the feedback form template of the design you build on (ezwebin's full/feedback_form.tpl, the media design's forms) for the exact hidden fields and validation include your installation uses. The shipped collect templates print inputs without ids; give your copies ids so the labels above work (Accessible forms).

After submitting

  • content/collectedinfo/<class>.tpl (for example feedback.tpl, form.tpl, poll.tpl in design/standard) is the thank-you page; override it for your look.
  • content/collectedinfomail/<class>.tpl builds the mail; its subject comes from {set-block scope=root variable=subject}.
  • collect.ini holds the collection settings per class (where answers are mailed, whether they are stored).

Security

  • The form token extension (ezformtoken) adds a token to forms that post to the site; keep the hidden fields your design's original template prints.
  • Validate on the server (the kernel does); do not rely on browser validation alone.
  • Never print collected answers back unwashed.

Accessibility

Labels, required marks in text, error summary with links to fields, autocomplete on personal fields (Accessible forms).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x