Repeater field (grouped)
ACPT (from v1.0.90) gives you the power to create a repeatable grouped field.
Create a repeater field
In order to create a new repeater field, choose it from the meta field select box:
As you select it, you’ll see the children elements list with a button labeled “Add field”.
As you may imagine you can create as many children fields as you want. You can sort and manage them as you normally do for the other meta fields.
Please notice that the repeater field and the post relation field are not allowed as children fields.
Styling the repeater field
After adding the child elements to the repeater field you have to create a template to display it on frontend.
Click on the icon on the repeater field box:
and then use the ACPT template builder as you already know.
You can drag the children fields on the template according to your preferences:
Save the template, you are ready to add content to your site.
A real example
Suppose you have a gym and you have to display the opening times somewhere in the website pages.
You need a repeater field with two children:
- a select field called “day“
- a text field called “opening time“
Then go to the page editor and add the content:
Good, you are done!