RelationManager section icon

Hello, I'm trying to add an icon to the section for my RelationManager. I've added an $icon variable to my RelationManager but it doesn't show up anywhere.
No description
Solution:
I think you are correct, doesn't seem possible with built-in functions. I ended up using the following workaround: I added the $icon variable like usual at the top of the file and in the 'table' function I added the 'heading' function to manually set it to a HtmlString. The code looks like this: ```php ->heading(new HtmlString(...
No description
Jump to solution
5 Replies
krekas
krekas5w ago
icon where?
siebsie23
siebsie23OP5w ago
On the image I attached, there is a title 'Orders'. I want to add an icon in front of there like the 'Objecten' section. The orders are loaded in via a RelationManager but I can't find a way to add an icon to it
No description
krekas
krekas5w ago
I think icons are only when managers are as tabs
Solution
siebsie23
siebsie235w ago
I think you are correct, doesn't seem possible with built-in functions. I ended up using the following workaround: I added the $icon variable like usual at the top of the file and in the 'table' function I added the 'heading' function to manually set it to a HtmlString. The code looks like this:
->heading(new HtmlString(
'<div class="flex items-center gap-3">' . svg(self::$icon, 'fi-section-header-icon self-start text-gray-400 dark:text-gray-500 fi-color-{$iconColor} h-6 w-6')->toHtml() . $table->getheading() . '</div>'
))
->heading(new HtmlString(
'<div class="flex items-center gap-3">' . svg(self::$icon, 'fi-section-header-icon self-start text-gray-400 dark:text-gray-500 fi-color-{$iconColor} h-6 w-6')->toHtml() . $table->getheading() . '</div>'
))
and gives me the following output:
No description
Want results from more Discord servers?
Add your server