Simple Repeatable Fields were added in Pods 2.9.
You can make fields repeatable so that you can enter multiple sets of values for many different field types.
Contents
Supported Pod Types and Field Types
- Post Types (meta-based)
- Taxonomies (meta-based)
- Users (meta-based)
- Comments (meta-based)
- Media (meta-based)
- Settings
NOTE: Table-based Pods are not currently supported. In the future, support for table-based storage will allow Repeatable fields to work for Advanced Content Types and any other table-based pod that you set up.
Supported Field Types
- Text
- Plain Text
- Website
- Phone
- Password
- Date/ Time
- Date/ Time
- Date
- Time
- Relationships / Media
- oEmbed
- Paragraph
- Plain Paragraph Text
- WYSIWYG (Visual Editor)
- Number
- Plain Number
- Currency
- Other
- Color Picker
Setting up a Repeatable field
When adding or editing your field, go to the “Repeatable” tab and you will find an option to make that field Repeatable.
Turning Repeatable on will now allow multiple values to be input, saved, and displayed.
Turning Repeatable off again will result in only the first value being input, saved, and displayed. If you disable Repeatable for a field that had multiple values saved, subsequent saves will overwrite all other values and only the single value saved will be left.
Inputting values with Repeatable fields
You can interact with a Repeatable field in the following ways:
- If there is one value, you will not see a reorder or remove button
- You can click “Add New” to add show another input that you can fill in
- When there are multiple values, you may reorder them or remove values
- There will always be at least one input even if the value is saved as empty
Saving values with Repeatable fields
Values will be saved to meta-based Pods across multiple meta values.
Displaying values with Repeatable fields
Normal magic tags will work as they do with Relationships with multiple values. Output will be comma-separated with a serial comma like: “Value 1, Value 2, and Value 3”
The more flexible way to interact with displaying these values is to use the [[each]] template tag which now has support for {@_value} to output an individual value and {@_index} to output the value position (starting at 0).