Is my Form Component possible?
I'm trying to create an "Outline Generator" in Filament. I have achieved this already using Livewire and the result is an array of h2's, with h3 information isde of them, etc. But I have no idea where to begin looking to try and achieve this in Filament or if it's even possible.
Is there a way to create a custom Form Component that looks like my "outline builder"?
User clicks "Add H2" which adds a Section for that H2 where you can select image placement and then add H3's under that H2.
6 Replies
It’s definitely doable. But not going to be necessarily easy. You’re looking at nested conditional repeaters and/or builder components.
Definitely going to need a custom form component for that layout though.
Would you know where I'd begin looking? I'm all for a challenge - I'm just struggling with where to look. How would I add a repeater within a repeater when someone clicks "add H2" for example. Add H2 -> Add repeater -> add H3 -> Add repeater within repeater
You can nest repeaters out of the box. Just add another repeater to the schema of the parent repeater.
Repeater::make(‘h2’)->schema([
Repeater::make(‘h3’)
])
So you can!
So - how would I change the design of a repeater? Is that possible?
Is there a way to just copy the current repeater component and change the layout?
Yep. I did it with the #awcodes-table-repeater plugin. Just extend Repeater and return a different view.
Yours will be more complicated, but the philosophy is the same.
Superstar! Ty