We use Formulaire forms in the forum to collect specific user feedback, e.g. for troubleshooting. The following terms are useful before you start setting forms
- Form submission – a submission is the data collection that a user fills in the form. There may be many submissions for a given form and they can be configured in a way that individual users can or cannot see submissions of other users. By default, submissions are visible, in order to make them private, you need to add a tag to the form (see below) and disable ‘view discussion’ permissions in the forum. Then, the submissions will be visible only to the authors and admins.
- Form discussion – a submission can be connected to the forum so that a new discussion thread is connected for each submission. This is suitable for forms where the user submissions are expected to be elaborated further such as for troubleshooting. Alternatively, the submissions can be considered as final, so called standalone forms.
- Replacement variables – you can use variables that inserts specific values into form fields by default. These are connected to user name or group, or to values from other fields using the slugs
- Slugs are URLs that allow to connect various pieces of information of a web page or a form.
- Form permissions – normal users are not supposed to have rights to create new forms or modify existing ones.
Making a form
- At the main page click ‘Form manager’ and then ‘New form’
- The form designer opens and you need to provide basic setup of the form
a. Enable expert mode as it will allow you to use slugs for field cross-references
b. Type of a form – either standalone or discussion fields. Do not use User profile unless really needed
c. Define a tag to which the form is connected. Formulaire extension then adds a link to the form to each discussion with that tag. If you leave it on default (‘For any tag’), the link will appear at all discussions, which is not desired.
d. Enable ‘Automatically create discussions’ if you want the submissions to be turned into discussions
e. Configure the appearance of a newly created discussion by clicking the ‘Options for new discussions’ – use can specify the title of a discussion with use of replacement variables and you can add additional tags to the discussion.
- Configure communication options.
a. Enable sending emails to participants, i.e. to the author of the form and notifications to as many email addresses as needed. The email addresses must be separated by comma and there must not be spaces between them.
b. Configure the email format, e.g. subject of the emails, in email templates. You can use replacement variables here as well.
- Design form fields. Fields are added to the by clicking ‘Add a field’ button. The new fields needs to be configured. The important properties are
a. Field type. Each type may add few more fields for specifying detailed properties of the field.
b. Title gives a name to the field.
c. Description provides a hint to a user about the information that he is supposed to fill in.
d. JSON key defines the slug, by which the content of the field can be referred to. You can either give your own slug or have it generated when you press ‘Save’. Slug ‘title’ is reserved for the title of discussion that is created from the submission.
e. ‘Required’ switch – enable to make the field mandatory.
You can add as many fields as needed with any types combination.
Cross-references
Content of various fields can be used as part of information created during the form submission, i.e. the notification emails or discussion threads. Such information can facilitate processing of the submission, e.g. filtering by email subject. The cross-references are realized via replacement variables. There are several predefined replacement variables, always in form of {variable_name}:
• {user_id}: ID of the submission owner.
• {user_display_name}: Display Name of the submission owner.
• {user_username}: Username of the submission owner.
• {user_email}: Email of the submission owner.
• {user_group_ids}: Comma-separated list of group IDs the submission owner belongs to.
• {user_group_names}: Comma-separated list of singular group names the submission owner belongs to.
Alternatively, a replacement variable can be a slug, unique identifier given to a form field and then referred to as {slug}. Slugs can be generated or specified by a user.
Documentation
For more details and updates, refer to the original documentation.