F
Filamentβ€’2y ago
Tim

Changing field wrapper view, to change label styling

I'm creating a registration wizard, with the Filament wizard component. But I need to do some custom styling in the input labels. After doing some searching, I found the fieldWrapperView() function. I couldn't find much documentation about it, but it seems to give the option to overwrite the field wrapper that includes the label. So I published the Filament Form views, copied the label component, changed the styling, and set the fieldWrapperView('livewire.components.field-wrapper.label'). Unfortunately, this doesn't seem to work, it can't find the label template at that location. I checked a lot of times, but I'm sure the view path is correct. Is this a bug? When I change the label field-wrapper in the vendor folder, it does work, but it adjusts the styling everywhere. That's not what I want, I only want the updated styling in the registration wizard. Is trying to use the fieldWrapperView() function the right way to do this, or are there better ways?
2 Replies
Dan Harrin
Dan Harrinβ€’2y ago
you dont need to publish views you would copy the index.blade.php and label.blade.php from the field wrapper directory into your views directory and then fix the blade component used in index.blade.php to point to your label component instead and then the fieldWrapperView() is the path to the index view, not the label view
Tim
TimOPβ€’2y ago
Hi Dan, I noticed the fieldWrapperView function is automatically looking in the view/components folder, so that was the reason it couldn't find the view template at first. I copied the index.blade.php and pointed it to the label.blade.php component and it works! Thanks for the help, and have a nice day πŸ™‚
Want results from more Discord servers?
Add your server