Upgrade to 3.7.0
This commit is contained in:
11
kirby/config/fields/structure.php
Normal file → Executable file
11
kirby/config/fields/structure.php
Normal file → Executable file
@@ -106,6 +106,7 @@ return [
|
||||
},
|
||||
'columns' => function () {
|
||||
$columns = [];
|
||||
$mobile = 0;
|
||||
|
||||
if (empty($this->columns)) {
|
||||
foreach ($this->fields as $field) {
|
||||
@@ -133,6 +134,10 @@ return [
|
||||
continue;
|
||||
}
|
||||
|
||||
if (($columnProps['mobile'] ?? false) === true) {
|
||||
$mobile++;
|
||||
}
|
||||
|
||||
$columns[$columnName] = array_merge($columnProps, [
|
||||
'type' => $field['type'],
|
||||
'label' => $field['label'] ?? $field['name']
|
||||
@@ -140,6 +145,12 @@ return [
|
||||
}
|
||||
}
|
||||
|
||||
// make the first column visible on mobile
|
||||
// if no other mobile columns are defined
|
||||
if ($mobile === 0) {
|
||||
$columns[array_key_first($columns)]['mobile'] = true;
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
],
|
||||
|
Reference in New Issue
Block a user