Conditionally change the background of a repeatable entry item

Is there an easy way of changing the background of an Infolist Repeatable Entry child item based on the record information
Solution:
Actually, nvm. I checked the RepeatableEntry template and there's no customization option for the child contianers, other than removing the whole container style. I'll just work with the styles of the TextEntry inside the repeatable entry schema and the $record of each item. ```php RepeatableEntry::make('course.episodes') ->schema([ TextEntry::make('title')...
Jump to solution
2 Replies
Solution
tuto1902
tuto19025mo ago
Actually, nvm. I checked the RepeatableEntry template and there's no customization option for the child contianers, other than removing the whole container style. I'll just work with the styles of the TextEntry inside the repeatable entry schema and the $record of each item.
RepeatableEntry::make('course.episodes')
->schema([
TextEntry::make('title')
->weight(fn (Model $record) => $record->title == 'foo' ? 'font-bold' : 'font-base')
])
RepeatableEntry::make('course.episodes')
->schema([
TextEntry::make('title')
->weight(fn (Model $record) => $record->title == 'foo' ? 'font-bold' : 'font-base')
])
`
Arnaud
Arnaud5mo ago
Maybe you can add custom class base on content. And play with css ?