Skip to content

Setup: Properties display

dante di domenico edited this page Dec 23, 2021 · 21 revisions

Edit configuration

Properties display can be set by Properties configuration in config/app.php.

Each key represents a module. I.e.:

'Properties' => [
    'documents' => [
        // ...
    ],
    'events' => [
        // ...
    ],
    'images' => [
        // ...
    ],
],

Each module can have setup for index, view, relations, filter, bulk, fastCreate.

index

'index' properties to display in index view (other than id, status and modified, always displayed if set). I.e.:

'Properties' => [
    'documents' => [
        'index' => [
            'title',
            'description',
        ],
    ],
],

view

_keep

'_keep' is a special group of properties to keep and display even if not found in object. I.e.:

'Properties' => [
    'users' => [
        'view' => [
            '_keep' => [
                'password',
                'confirm-password',
            ],
        ],
    ],
],

core

Put in 'core' the properties you want to always be open on the top of the view of your module. You can also set an element to be included in "core" section. I.e.:

'Properties' => [
    'documents' => [
        'view' => [
            'core' => [
                '_element' => 'MyPlugin.Form/documents_view_core',
                'title',
                'description',
            ],
        ],
    ],
],

publish

'publish' is used to group fields publishing related. Fields will be in publish-properties area in the view. I.e.:

'Properties' => [
    'documents' => [
        'view' => [
            'publish' => [
                'uname',
                'status',
                'publish_start',
                'publish_end',
            ],
        ],
    ],
],

advanced

'advanced' fields can be set in this confit. You can also include a custom element from another plugin, i.e:

'Properties' => [
    'documents' => [
        'view' => [
            'advanced' => [
                 // Use custom element in `MyPlugin` to display this group
                 '_element' => 'MyPlugin/advanced',
                 'extra_field',
            ],
        ],
    ],
],

other

'other' section contains all "remaining attributes" not in other sections, or the fields you set. I.e.:

'Properties' => [
    'documents' => [
        'view' => [
            'other' => [
                 'body',
            ],
        ],
    ],
],

custom

Custom name can be added as key, like 'my_group' or 'some_info' => a tab named My Group or Some Info will be generated inside any of the groups above an optional '_element' can define a custom view element for this group. I.e.:

'Properties' => [
    'users' => [
        'view' => [
            'personal data' => [
                'person_title',
                'gender',
                'birthdate',
                'vat_number',
            ],
            'contact info' => [
                'phone2',
                'email2',
                'website',
                'street_address',
                'city',
                'zipcode',
                'country',
                'state_name',
                'delivery_address',
            ],
        ],
    ],
],

relations

Relations ordering by relation name. Optional keys: 'main', 'aside', '_element'.

Set in 'main' first relations to show on main column, other relations will be appended. Set in 'aside' relations to show on right aside column. Set in '_element' custom template path per relation.

An example:

'Properties' => [
    'events' => [
        'relations' => [
            'main' => [
                'poster',
                'has_location',
            ],
            'aside' => [
                'seealso',
            ],
            '_element' => [
                'poster' => 'MyPlugin.Form/posters',
                'has_location' => 'MyPlugin.Form/locations',
            ],
        ],
    ],
],

filter

Set 'filter' for filters to display. I.e.:

'Properties' => [
    'users' => [
        'filter' => [
            'status',
            'roles',
        ],
    ],
],

bulk

Bulk actions fields. I.e.:

'Properties' => [
    'documents' => [
        'bulk' => [
            'status',
        ],
    ],
],

fastCreate

Fast create form config is used in side panel, when adding objects to a relation. You can customize fields by module: 'required' to set fields that cannot be left empty, 'all' for all fields to show in form. I.e.:

'Properties'
    'links' => [
        'fastCreate' => [
            'required' => ['status', 'url'],
            'all' => ['status', 'url', 'title', 'description'],
        ],
    ],
],
Clone this wiki locally