Super Table is a Craft CMS field type to allow you to create powerful tables. You can utilise all your favourite native Craft field types in your tables, including Assets, Users, Entries and even Matrix. Also supports many third-party field types.
Creating a Super Table field is very similar to a Matrix field. First, select your desired Field Layout, then use the Configuration to define your fields.
Craft
- Assets
- Categories
- Checkboxes
- Color
- Date/Time
- Dropdown
- Entries
- Lightswitch
- Matrix
- Multi-select
- Number
- Plain Text
- Position Select
- Radio Buttons
- Rich Text
- Table
- Tags
- Users
Third-Party
...and many more. Super Table can handle just about any FieldType, the above are simply those that have been tested.
For any Super Table, you can choose between two layout options - Row and Table. This is an option when creating your Super Table field. The Table layout will present fields vertically and in a tabular format - exactly as you'd expect from a Table field. Row on the other hand will present fields horizontally, similar to how a Matrix field works.
Which layout you choose will likely depend on what sort of fields you have in your Super Table, and the number of fields. For a Super Table containing 4 or more fields, your best option is to use the Row Layout.
To illustrate the different layout options, refer to the below, which are the same field using both Table and Row layouts.
The Row Layout also shines brightest when using inside a Matrix field as below.
A Super Table field can be set to be static, which turns the field into a non-repeatable collection of fields. This can be useful for a multitude of cases where you wish to simply group a collection of fields together, and not necessarily have them repeatable.
- Add ability to collapse rows.
- Allow for SuperTable-in-SuperTable - because why not.
- Support column duplication in SuperTable field settings.
Below are major release notes when updating from one version to another. Breaking changes will be listed here.
As a rule of thumb, a Super Table field acts almost identically to a Matrix field, so templating and custom development should be similar to a Matrix field. Below are a few resources for developers.
- Templating examples
- Updating a Super Table field from a front end form
- Fetching content from a Super Table field via plugin
- Programatically saving a Super Table field with content via plugin
Errors or trouble saving Matrix / Super Table combination
If you're using a Matrix / Super Table combination, you'll likely need to alter the max_input_vars
and post_max_size
setting in your php.ini
file. Whether this is a necessary change depends on your server setup, but its advised that you make this change regardless to ensure data isn't lost. This will ensure your fields save correctly, and data is not lost. You may experience a 500 error on save, or a semi-blank screen when saving your content. This can also be a common problem with Matrix and other fields - see http://craftcms.stackexchange.com/a/2777.
Thanks go to @brandonkelly and @benparizek for their input, ideas and suggestions.
- Craft 2.6.2771+.
- PHP 5.4+