F
Filamentβ€’4mo ago
Adysone

Display breadcrumbs and title of the page in topbar

Hello, I need to display breadcrumbs and title of the page in the topbar. It works like a charm on list pages, but as soon as I go on a Edit ou Create Page, I got this error: Using $this when not in object context. I tried to use the controller in my blade template but I got another error on EditRecord page: Typed property Filament\Resources\Pages\EditRecord::$record must not be accessed before initialization You'll find the code in the code.php attached file. I don't have any clue of what I can do to reach my goal (illustrated by the screenshot). Thanks in advance!
5 Replies
Adysone
AdysoneOPβ€’4mo ago
hello, anyone to help me? πŸ˜„
toeknee
toekneeβ€’4mo ago
You won't be abe to use $this in pages I suspect because $this isn't define it's $record If I remember correctly? The only way I can see this working, is if you set them with JS from within the original blade. The breadcrumbs are set on the view caller natively
Adysone
AdysoneOPβ€’4mo ago
So, I can't access the $record from the topbar-title blade view?
toeknee
toekneeβ€’4mo ago
Not to my knowlage as it's outside of the component
Adysone
AdysoneOPβ€’4mo ago
Ok, thanks!
Want results from more Discord servers?
Add your server