Advanced Configuration
Simple Grids & Tables was designd to be simple, hence the name, however there have been many requests to add more configuration options to the columns in a Simple Grid field. Instead of a large refactor, and complicating the UI of a Simple Grid field configuration screen, you can now manage the configuration options of each column by adding an array to your site's config.php file. You can define global options that apply to every column type, or define the options of a specific column in a field. Since this is an advanced configuration you will need to inspect the HTML and find the IDs, or take note of the IDs in the URL when editing the fields.
Support is not provided to help find the IDs of your fields and columns, but here are some examples of how to find them:
Finding the IDs in a standalone channel field
Finding the IDs in a Bloqs field

Example Config

1
$config['simple_grid'] = [
2
// Examples of global overrides for each field type with their default values and possible options.
3
// These settings will be applied to every instance of the field type, regardless of where it appears.
4
// You can define field specific options (examples below), then default all remaining instances of
5
// a column type to the global settings if defined.
6
'file' => [
7
'allowed_directories' => '', // [int] (ID of upload directory)
8
'field_content_type' => 'all', // image
9
'num_existing' => 0, // [int]
10
'show_existing' => 'y', // y, n
11
],
12
'text' => [
13
'field_content_type' => 'all', // numeric, integer, or decimal
14
'field_show_file_selector' => 'n', // y
15
'field_text_direction' => 'ltr', // rtl
16
'field_maxl' => 256, // [int]
17
'field_show_fmt' => 'n', // y
18
'field_fmt' => 'n' // y
19
],
20
'url' => [
21
'url_scheme_placeholder' => 'https://',
22
'allowed_url_schemes' => [
23
'http://' => 'http://',
24
'https://' => 'https://',
25
'//' => '// (Protocol Relative URL)',
26
'ftp://' => 'ftp://',
27
'mailto:' => 'mailto:',
28
'sftp://' => 'sftp://',
29
'ssh://' => 'ssh://',
30
]
31
],
32
33
// Examples of overriding the settings on a per-field/column basis
34
35
// Standalone Simple Grid fields
36
'field_id_9' => [ // field_id
37
'col_id_2' => [ // Simple Grid col_id
38
'allowed_directories' => 5
39
],
40
],
41
'field_id_21' => [
42
'col_id_3' => [
43
'allowed_directories' => 6
44
],
45
],
46
// When Simple Grid field is inside of a Bloqs field. Note we don't care about the Bloqs' field_id
47
'col_id_9' => [ // Bloq atom_id, not the Bloq field_id
48
'col_id_1' => [ // Simple Grid col_id
49
'field_maxl' => 3,
50
],
51
'col_id_3' => [ // Simple Grid col_id
52
'allowed_directories' => 6,
53
]
54
],
55
];
Copied!

Supported Config Options

Below is a list of fieldtypes and the override options along with their default values that are supported by Simple Grid. Other available options values are noted next to the option after the // code comment.

Date and DateTime Fields

No config override options

File Field

1
'allowed_directories' => '', // [int] (ID of upload directory)
2
'field_content_type' => 'all', // image
3
'num_existing' => 0, // [int]
4
'show_existing' => 'y', // y, n
Copied!

Textarea

1
'field_ta_rows' => '6', // [int]
2
'field_show_formatting_btns' => 'n', // y
3
'field_text_direction' => 'ltr', // rtl
Copied!

Text

1
'field_content_type' => 'all', // numeric, integer, or decimal
2
'field_show_file_selector' => 'n', // y
3
'field_text_direction' => 'ltr', // rtl
4
'field_maxl' => 256, // [int]
5
'field_show_fmt' => 'n', // y
6
'field_fmt' => 'n' // y
Copied!

Toggle

1
'field_default_value' => '0', // 1
Copied!

URL

1
'url_scheme_placeholder' => 'https://',
2
'allowed_url_schemes' => [
3
'http://' => 'http://',
4
'https://' => 'https://',
5
'//' => '// (Protocol Relative URL)',
6
'ftp://' => 'ftp://',
7
'mailto:' => 'mailto:',
8
'sftp://' => 'sftp://',
9
'ssh://' => 'ssh://',
10
]
Copied!
Last modified 4mo ago