Before you start
Any page of your form can be set as repeatable, but the following restrictions apply.
Only multi-page forms
Only forms with more than one page can have their pages set as repeatable. If you try to make a single page form repeatable, the forms designer will display an error message.
Forms with external type definitions
Forms with external types, or forms used as external types for other forms, do not support repeating pages.
Forms in iCM
Forms used for article extras or subsite configuration are always single page, so don't support repeating pages. Forms displayed via shortcuts in iCM can have repeating pages.
Examples
There are three example forms which use repeating pages in different ways in the Example Repeating Page Forms section.
Page settings
The options for repeating pages are held in a page's settings.
Page Name
Take care that the name of your page does not match the name of any fields on your form. A future release will highlight this as an error and prevent you saving the page name.
Repeatable
This setting controls whether or not a page is repeatable. If false, a user will see the page once, then move on to the next. If true, they'll be able to generate multiple repeats of the page.
Validate Instance Count
Set this as true to use the minimum and maximum settings below. If false, a user will be able to generate any number of page instances (up to a maximum of 100) and the minimum and maximum settings will be ignored.
Minimum and Maximum Instances
These settings only apply if the count is being validated.
If enabled the "Wizard Buttons", "Wizard Buttons - Repeating Page", "Navigation Button", and "Submit Button" field types will validate the number of page instances. The validation will check the current number of page instances against the "Minimum Instances" and "Maximum Instances" page properties. The validation will be performed when a user attempts to leave the repeating page or when attempting to add a page instance.
If both the minimum and maximum are set as 0, the page will be skipped.
Error Message
This message is displayed when Validate Instance Count is true and the count of instances doesn't meet the minimum or maximum.
The default is "You must provide
The following tokens can be used:
#PAGEINSTANCE# - The page instance that's currently being displayed (zero-based, ie the first instance is 0)#PAGEINSTANCEDISPLAY# - The user friendly current page instance (one-based, ie the first instance is 1)#PAGEINSTANCEMIN# - The minimum number of instances set in the forms designer#PAGEINSTANCEMAX# -The maximum number of instances set in the forms designer#PAGEINSTANCECOUNT# - The current number of instances (of this page) that have been generated
Controls and navigation
Wizard Buttons - Repeating Page
Once a page has been set as repeatable, the Wizard Buttons - Repeating Pages field type provides the controls for a user to add, remove and edit pages.
Leave all of the properties of this field as they are to use the default behaviour described below. The documentation for the field describes how it can be customised.
Add another
This button creates a new page instance and navigates to it. It is hidden when you are editing or removing an existing instance, and will also be hidden if you reach the maximum allowed instances and the instance count is being validated.
Update
When an existing instance is being edited, the update button saves your changes and navigates to the page you were just on.
Remove
You'll see this button when navigating between page instances. Pressing remove loads the confirmation page, which is the page instance in read-only "remove" mode.
Confirm remove
Pressing confirm deletes the instance and navigates to the page and instance you were just on.
Cancel
Cancels the current action. You'll see the button when adding an instance after the first, or if you update or remove an existing instance. You'll be returned to the page and instance you were just on.
Wizard and Navigation Buttons
As well as navigating between pages, the standard Wizard Buttons and Navigation Button will also navigate between page instances. Once you have created several instances of a page, the next and back modes of the buttons will navigate through them in the same way as they navigate through regular pages. Once you've reached the final, or first, instance of a repeating page, the buttons will take you back or forwards to the next page of the form.
If you have set the instance count to be validated in the page settings, the number of instances must meet the minimum and maximum requirements before you can navigate to another page.
If you have set an exact number of instances (ie the minimum and maximum are the same) the next mode of the buttons will automatically add a new page instance and navigate to it until the required number of instances is reached, at which point it will navigate to the next page.
Submit Button
Repeating pages can include a Submit Button. If the instance count passes validation the form will be submitted.
Actions
Form actions (sending emails, starting workflows, saving data etc) are never triggered by adding, removing or editing page instances. They will be triggered if you use wizard or navigation buttons to navigate between page instances and when the page is submitted (whether that's a form submission or navigating to the next page).
Displaying data from page instances
The data submitted on repeating pages can be displayed to a user using an HTML Template (server-side).
Summary cards
The example templates in the Handlebars Editors work with repeating pages. Add the template field to a page of your form that comes after the repeating page, then pick your repeating page from the drop-down.
The example summary card templates include the page title, and displays a card for each page instance. Each card includes the instance number, the form fields on the page, and links to edit or remove the instance.
The cards also include buttons to edit and remove an instance. These buttons will only work if your summary cards are placed on a page other than a repeating page. If you want to display the cards on the repeating page, edit the templates to remove the NAVIGATIONBUTTON sections.
Customising the template
A range of Page Instance Handlebars Helpers have been added to display information about page instances. Existing helpers have also been updated so you can specify which page instance you need.
Example
The Navigation Model example shows this form working.