GridController is coming!

Hi,

I’m currently working on a GridController like the ListController, and its Grid widget.

In Consideration

  • columns management for each field,
  • specific image field like avatar, banner, etc…
  • buttons/actions to display
  • Toggle button to list view like ListController
  • …

I’m opened to any suggestions or ideas to improve it.

(Front UI is not done :slight_smile: )

Public repository soon

Best,

9 Likes

Uoh… this is an amazing idea!

I got a “grid controller” in my plugin, too, but basically it’s a lot of CSS hacks using one column for the grid view and all others for the list view. Depending on if grid or list is used, I hide columns. It works, but it can surely dont better.

1 Like

Grid Cards for October CMS

Display the backend lists of October CMS 4 as a grid of cards instead of a table.

GridController is a drop-in replacement for the ListController: the configuration file, toolbar, search, filters, sorting, pagination, bulk actions, list setup, controller overrides (listExtendQuery, listInjectRowClass, …) and reordering keep working.

Requirements

  • October CMS 4.4 or later
  • PHP 8.2 or later

Installation

composer require lucaspalomba/grid-plugin

Quick start

Replace the ListController behavior with the GridController and rename $listConfig to $gridConfig:

public $implement = [
    \Backend\Behaviors\FormController::class,
    \LucasPalomba\Grid\Behaviors\GridController::class,
];

public $gridConfig = 'config_grid.yaml';

Then place the columns in the card:

columns:
    cover:
        type: image
        cardSection: media
    status:
        type: selectable
        cardSection: badge
    name:
        cardSection: header
    price:
        type: number
        cardSpan: half
    stock:
        type: number
        cardSpan: half
    updated_at:
        type: timetense
        cardSection: footer

The view renders the grid like a list: <?= $this->listRender() ?>.

Documentation

The full reference (card sections, field widths, grid options, layouts, reordering, customization) is in docs/marketplace/documentation.md.

Screenshots

License

MIT

1 Like