Skip to content

Splitting up forms over multiple cards #47

Open
@JoepdeJong

Description

@JoepdeJong

Hi everyone,

I have implemented blocks, which allow me to split op a crud form over multiple cards/columns using e.g. col-md-6.
Screenshot 2023-01-22 at 14 58 52

The config is similar to tabs: add 'block'=>'block_name' to a field. To customize blocks, e.g. styling and title, one can use blockOptions:

        $this->crud->setOperationSetting('blockOptions', [
            'general' => [
                'wrapper_class' => 'col-md-12 compact-form',
                'show_title' => false,
            ],
            'pickUpAddress' => [
                'wrapper_class' => 'col-md-6 compact-form',
                'title' => __('order.pick_up_address'),
                'show_title' => true,
            ],
            'deliveryAddress' => [
                'wrapper_class' => 'col-md-6 compact-form',
                'title' => __('order.delivery_address'),
                'show_title' => true,
            ],
            'goods' => [
                'wrapper_class' => 'col-md-12 compact-form',
                'title' => __('order.goods'),
                'show_title' => true,
            ],
            'goodsRetour' => [
                'wrapper_class' => 'col-md-12',
                'title' => __('order.goods_retour'),
            ]
            ]);

At the moment, I implemented this by overwriting the CrudPanel class and adding a Blocks trait. This means that it breaks when these files are updated in Backpack.

Do you know if there is any interest in this functionality? In that case, I could clean up my code, fork Backpack, and make a PR. Or are there any other possibilities to extend CrudPanel, Fields, and FieldsProtectedMethods without editing the backpack core?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions