-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to edit breadcrumb ? #84
Comments
Hello @dsnoeck, Glad that you are finding the package helpful, that is why I created it and decided to release it open-source. Yeah I have to work on the documentation! That giant readme is not great even when it has all the information. At the moment the crumb trail is kinda static and automatically generated based on how the menu structure is defined and the current page viewed. It's best explained with an example: Given this partial menu:
The bread crumb rendering is called in
The method signature is:
So for all pages using the default theme, the leaf will be The root is the left most part of the trail and the leaf the right most part, so if a user clicks on the Roles link, one would expect the crumb trail to look as such: ```Admin > Role". How does the system figures out the leaf when a null is passed? From the current request URL, it tries to find a match in the Menu definition. This works for all items that are defined in the menu but, when the user clicks on the link to edit a role the URL no longer matches anything in the menu. So it's also possible to overwrite the leaf node with a session variable, that way in the Role controller one can set:
And every pages/views generated as a result of this controller will have the crumb trail "Admin > Role" otherwise if the leaf is not defined or deduced, the crumb trail is blank. So currently the crumb trail is limited to rendering items that are defined in the menu only. There is no way to have a crumb trail like this "Admin > Role > Accountants > Edit", but in the future I want to allow this kind of functionality, I just have not had the time just yet. I hope that this clarifies the crumb trail and menu system for you a little. Let me know if you have another questions. Ciao. |
Hello @sroutier, Thank you very much for the detailed response. Unfortunately, I needed a breadcrumb with more details. So, if I find the time to do it, I will submit a pull request. I leave up to you to close or not this issue. Cheers, |
Would love to have a good PR to make the breadcrumb more flexible and useful. |
Hi, sorry it's me again ;-)
I want to edit the breadcrumb for the different pages I have created, but I don't find the way to do it.
It might be good to add it to the documentation.
BTW, your package is awesome, many thanks.
The text was updated successfully, but these errors were encountered: