Modifying Layouts to Display Additional Columns
Overview
By default, the record view layout for each module displays two columns of fields. The number of columns to display can be customized on a per-module basis with the following steps.
Resolution
First, you will want to ensure your layouts are deployed in the custom directory. If you have not previously customized your layouts via Studio, go to Admin > Studio > {Module Name} > Layouts. From there, select each layout you wish to add additional columns to and click 'Save & Deploy'. This action will create a corresponding layout file under the ./custom/modules/{Module Name}/clients/base/views/record/ directory. The file will be named record.php.
In your custom record.php
file, locate the maxColumns
value under templateMeta
array, and change it to the number of columns you would like to have on screen:
'maxColumns' => '3',
Once that is updated, locate the widths
array to define the spacing for your each column(s). You should have a label and field entry for each column in your layout:
'widths' => array (
0 => array (
'label' => '10',
'field' => '30',
),
1 => array (
'label' => '10',
'field' => '30',
),
2 => array (
'label' => '10',
'field' => '30',
),
),
Next, under the existing panels
array, each entry will already have a columns
property, with a value of 2
. Update each of these to the number of columns you set for maxColumns
:
'columns' => 3,
Once the file has been modified, you can navigate to Studio and add fields to your new column in the layout. For any rows that already contain two fields, the second field will automatically span the second and third column. Simply click the minus (-) icon to contract the field to one column and expose the new column space:
After you have added the desired fields in Studio, click 'Save & Deploy' to finalize your changes
Column Widths
Studio does not support expanding a field beyond two column-widths. If you want a field to span the full layout (all three columns), you would need to manually update this in the custom record.php like so:
array (
'name' => 'description',
'span' => 12,
)
Changing the span
value from 8
to 12
. After saving the changes on the file, you would then run a Quick Repair and Rebuild. However, any updates in Studio will revert the span back to 8
.