Site-Aware FormsProNew in 5.2+, Improved in 5.7+
Allows you to optionally enable Site awareness in Freeform to show/hide them for specific Sites and enable translations per site for forms to have unique labels and messages on the front end.
Overview
When this feature is enabled, forms become aware of the currently active Site when loaded on the front end. In the control panel, you can filter form lists by Site and prevent other admins from accessing forms that belong to Sites they don't have access to. By default, any new forms created will be visible for the Site they were created on (with the ability to enable additional sites).
To enable translations on forms per Site, go to the form builder and enable the 'Translatable' setting under the 'Settings' tab.
Settings
Inside the General Settings page, you can enable this feature by toggling ON the Site-Aware Forms setting (or sitesEnabled: true
in Project Config).
Form BuilderUpdated in 5.7+
Once enabled, an additional Sites setting and Translatable toggle will appear for forms inside the Settings tab of the form builder.
TranslationsNew in 5.7+
Once the Translations setting is enabled for a form, various parts of the form will become available for translation. The translation process is similar to other areas within the Craft control panel. You will notice the familiar translation icon next to any setting that can be translated. To set a different value for other sites, use the Site picker at the top of the page.
The translation icon will turn blue if a translation exists for a site other than the primary site. Clicking this icon will allow you to cancel the translation value for that site and revert it to the configuration set for the primary site.
Translatable Settings
Various settings for forms become translatable, including form name and description, processing text, and success and error messages.
Translatable Fields
Various settings for fields become translatable, including label, instructions, placeholder, default value, and custom error validation message.
Translatable Field Options
If a field contains options such as Dropdowns or Checkboxes, the option labels can be translated, while the option values remain fixed for sites other than the primary site. Additionally, the same set and quantity of options must be maintained across all sites.
Translatable Items
The following items are translatable:
- Settings →
- General →
- ✓ Form Name
- ✓ Form Description
- Processing →
- ✓ Processing Text
- Success & Errors →
- ✓ Success Message
- ✓ Error Message
- General →
- Form Layout →
- ✓ Page Tab Names
- Submit Buttons →
- ✓ Labels
- Fields →
- ✓ Label
- ✓ Instructions
- ✓ Placeholder
- ✓ Default Value
- ✓ Custom Validation Error
- Custom Options →
- ✓ Option Labels
Options and labels inside of Opinion Scales and Table fields are currently not translatable at this time.
Field Compatibility
The chart below shows the translatable options for each field type.
Field Type | Label | Instructions | Placeholder | Default Value | Error Message | Option Labels | Special |
---|---|---|---|---|---|---|---|
Calculation | ✓ | N/A | N/A | ✓ | ✓ | N/A | ✕ Calculation Logic |
Checkbox | ✓ | ✓ | N/A | ✓ | ✓ | N/A | ✕ Checked by Default |
Checkboxes | ✓ | ✓ | N/A | ✕ | ✓ | ✓ | ✕ Element Sources, ✕ Predefined Options |
Confirm | ✓ | ✓ | ✓ | N/A | ✓ | N/A | N/A |
Date & Time | ✓ | ✓ | ✓ | ✕ | ✓ | N/A | ✕ Force Locale, ✕ Date/Time Configuration |
Dropdown | ✓ | ✓ | N/A | ✕ | ✓ | ✓ | ✕ Element Sources, ✕ Predefined Options, ✕ Empty Option Label |
✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A | |
File Upload | ✓ | ✓ | N/A | N/A | ✓ | N/A | ✕ Asset Source, ✕ File Configuration |
File Upload Drag & Drop | ✓ | ✓ | ✕ | N/A | ✓ | N/A | ✕ Asset Source, ✕ File Configuration |
Group | ✓ | ✓ | N/A | N/A | N/A | N/A | N/A |
Hidden | ✓ | N/A | N/A | ✓ | N/A | N/A | N/A |
HTML | ✓ | N/A | N/A | N/A | N/A | N/A | ✕ Content |
Invisible | ✓ | N/A | N/A | ✓ | N/A | N/A | N/A |
Multiple Select | ✓ | ✓ | N/A | ✕ | ✓ | ✓ | ✕ Element Sources, ✕ Predefined Options |
Number | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✕ Value Configuration |
Opinion Scale | ✓ | ✓ | N/A | ✕ | ✓ | ✕ | ✕ Options, ✕ Scales |
Password | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
Phone | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✕ Pattern Validation |
Radios | ✓ | ✓ | N/A | ✕ | ✓ | ✓ | ✕ Element Sources, ✕ Predefined Options |
Rating | ✓ | ✓ | N/A | N/A | ✓ | N/A | N/A |
Regex | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✕ Pattern, ✕ Pattern Error |
Rich Text | ✓ | N/A | N/A | N/A | N/A | N/A | ✕ Content |
Signature | ✓ | ✓ | N/A | N/A | ✓ | N/A | ✕ Configuration |
Stripe Payment | ✓ | ✓ | ✕ | N/A | ✓ | N/A | ✕ Payment Description, ✕ Configuration, ✕ Redirect URLs |
Submit buttons | ✓ | N/A | N/A | N/A | N/A | N/A | ✕ Positioning |
Table | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ Button Labels/Markup |
Text | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
Textarea | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
Website | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
Site Switcher
The Site switcher will be present in several areas of the Freeform control panel.
Forms
Forms can be filtered by Site(s) they are assigned to. If a user only has access to one or some of the Sites, the Site switcher will automatically limit what is visible to them.
Site 1 Example
Site 2 Example
Site 3 Example
Submissions
The Submissions index will filter its form source filters by forms that are available for the active Site, and the All Submissions source filter will only display submissions for forms that are available for the active Site.
Export Profiles
Export profiles will become filtered by forms that are assigned to the active Site.
Templates
It's important to note that if a form is only enabled for Site A and Site B, it will show when viewing Site C in the front end.
Retroactively Apply to Existing Installs
If you wish to enable this feature retroactively to an existing Craft install, please follow the steps below:
Enable the Site-Aware Forms setting in Freeform.
Open up each form, update the Sites setting inside the Settings tab and save the form.
- Repeat for every form on your site.
- By default, every form will have NO Sites checked off, but Freeform assumes the form should be active for ALL Sites if that is the case.
Run the following CLI command (otherwise only your primary site will be able to see submissions in the control panel):
php craft freeform/submissions/resave
What It Doesn't Do
Here are some things it cannot do:
- Translations of Freeform submissions per site.
- Unique settings per site.
- Unique integrations per site.