Resource record title with Html

I have a hotels resource, where some of the hotels have HTML inside their name, like Hotel XY <sup>Superior</sup>. On edit pages and inside the breadcrumb, this looks obviously uggly, since its rendered htmlencoded. I tried to make the record title a HtmlString:
public static function getRecordTitle(?Model $record): ?string
{
return new HtmlString($record->name);
}
public static function getRecordTitle(?Model $record): ?string
{
return new HtmlString($record->name);
}
But this doesn't work, neither in the HotelResource nor in the EditHotel class. Any ideas or isn't it just not possible?
2 Replies
Dennis Koch
Dennis Koch2y ago
Not sure whether that return type was already there or you set it but it is string
bernhard
bernhardOP2y ago
Good point. The return type comes from the parent class I can't change it of course, so its not possible atm I guess to have html in the title created a PR to fix this.
Want results from more Discord servers?
Add your server