Prepend a page (or other type) to breadcrumbs
Currently I am trying to prepend my custom page "Settings" to some resource pages.
I found about the getBreadcrumbs function and tried to overwrite it by simple copying the current one and adding my item like so:
The thing is, I have a lot of resources that fall under this "Settings" page.
Is there any simpler and/or more correct way, besides making a helper function, to do this?
Thanks in advance!
3 Replies
I found your post looking for the same, your tip solved my issue!
As for having the same/similar settings, I've wondered about using a Trait or as you suggest a helper method.
For now, I only have one Resource that needs it - but I wanted to say thanks for your snippet!
Glad I could help you with it!
Eventually I did just put it in a helper function:
And then used it in Create & Edit like so:
ooh handy, thanks for sharing!