Repeatable content based on template selected

Hey Everyone, I followed a trick on the site for “Template based forms” but I’m wanting to modify it so that my repeatable content area is populated based on the template selected. Article: Template Based Forms I created 4 page templates based off of the example in the article but I also added a protected array $layouts = [‘homepage’, ‘page’]; where I want to specify what templates the page templates are available on. On my PageResource.php file, I have declared the following for the form.
php
Return $form
->columns(3)
->schema([
Tabs::make()
->columnSpan(2)
->tabs([
Tab::make(‘Content’)
->schema([
Repeater::make(‘content’)
->schema([])
])
])
Section::make()
->schema([
Select::make(‘layout’)
->options([
‘homepage’ => ‘Homepage’,
‘page’ => ‘Standard Page’
])
])
])
php
Return $form
->columns(3)
->schema([
Tabs::make()
->columnSpan(2)
->tabs([
Tab::make(‘Content’)
->schema([
Repeater::make(‘content’)
->schema([])
])
])
Section::make()
->schema([
Select::make(‘layout’)
->options([
‘homepage’ => ‘Homepage’,
‘page’ => ‘Standard Page’
])
])
])
Could anyone help me fix this.
Filament
Template based forms by Dennis Koch - Tricks - Filament
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server