Disable or modify Breadcrumbs
Hey - I couldn't figure it out with the docs or searching the help ( π ), so hopefully someone with experience can answer me my three questions. π
Given the following scenario:
I got a resource that is listing articles and was created with the
--view
-Parameter. Now when I open one of the listed articles I would expect the breadcrumb to be like Articles -> Listing -> ArticlenameXYZ (whatever the model itself says in the column "articlename").
But 2 problems with that:
- The Listing is beeing skipped... -> How do I fix that?
- I can set a static name via protected static ?string $breadcrumb
, but how can I set a dynamic one?
And lastly (since I might need it later): How can I disable Breadcrumbs on a page?12 Replies
you can override the getBreadcrumbs() method on any page and return an array of url=>label entries
so you can do whatever you want with that, add your own items, remove all of them
Thanks - I got this far myself by now. π
But doesn't seem to work on Resources?
For anyone looking this up in Discord:
Works at least on Pages...
How do I do that on a Resource? Setting
protected static ?string $breadcrumb = '';
or protected static ?string $breadcrumb = null;
seems to have no effect and the getBreadcrumb-Function only seems to set the last entry and not the overall breadcrumb.return [] from the getBreadcrumbs
getBreadcrumbs() is not defined in a Resource and even writing it with retun [] has no effect. I'm talking about the Resource-Listing here. π
it should be on the page class, not the resource class
so do I have to create a separate listing-page and can not just use the table-function?
and define it within the resource?
i dont know what you mean, sorry
the List page exists already
Okay - maybe I need to clarify. π
I made a Resource which created the listing-page for me (hence the table-function). I do not want a breadcrumb there. Like above the listing. There is one - I want it gone. How do I achieve that? π
look at the files in the Pages/ directory of the resource
there is a list page
Thank you! The page-file was the missing peace there. π