-
So I am curious if it is possible to next components. I would like to have a grid based design on a page and allow this to be easily customized. Additionally, I want to define if a component would be full width or contained (container). I might be missing some notes/documentation on this, or it simply may not be possible. Any advise would be awesome though! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Here is a simple implementation of a grid block, with a toggle for full_width class GridBlock extends PageBlock
{
public static function getBlockSchema(): Block
{
return Block::make('grid')
->schema([
Toggle::make('full_width')
->label('Full width')
->default(false),
TextInput::make('columns')
->label('Columns')
->integer()
->required(),
PageBuilder::make('blocks')
->blocks([
MyBlock::getBlockSchema(),
]),
]);
}
} @props([
'blocks' => [],
'columns' => 1,
'full_width' => false,
])
<div {{ $attributes->class("px-4 py-4 md:py-8") }}>
<div
@class([
'grid',
'max-w-7xl mx-auto' => ! $full_width,
])
style="grid-template-columns: repeat({{ $columns }}, minmax(0, 1fr));"
>
<x-filament-fabricator::page-blocks :blocks="$blocks" />
</div>
</div> |
Beta Was this translation helpful? Give feedback.
-
That is awesome thank you for the tip!!! |
Beta Was this translation helpful? Give feedback.
-
@Z3d0X This is not working with the current version, it causes a 502 segfault error, am I missing something ? |
Beta Was this translation helpful? Give feedback.
Here is a simple implementation of a grid block, with a toggle for full_width