You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_tree_current_item returns None for admin app, which leads to empty breadcrumbs here.
We've build our whole app at the top of django admin and we want to use breadcrumbs here too (in fact, we're using sitetree's breadcrumbs in our app using sitetree in version 1.5.0*, where everything is working fine). I don't see any point in not providing breadcrumbs for admin app - sitetree could return list of breadcrumbs, but until sitetree_breadcrumbs is called, nothing happen.
I could provide PR with fix/change for this, but first I want to discuss the idea behind current solution.
*In version 1.5 there was simple check if app is admin app (maybe it wasn't perfect, but it was working in our case) - this simple check was as follows:
This was a compatibility shim — reported in #201, addressed in #204
Right now I can't remember why there is no bypass for breadcrumbs, so I should take a pause for one day.
It might be somehow related to #84
Custom admin related theme was also raised in #185
It seems we need some tests to check breadcrumbs in conjunction with dropdowns (e.g. TreeItemChoiceField).
After that it'll probably be safe to bypass admin check for breadrumbs.
Tests and pull request are welcome.
Why admin app has special treatment for breadcrumbs?
In breadcrumbs method there is such piece of code:
get_tree_current_item
returnsNone
for admin app, which leads to empty breadcrumbs here.We've build our whole app at the top of django admin and we want to use breadcrumbs here too (in fact, we're using sitetree's breadcrumbs in our app using sitetree in version 1.5.0*, where everything is working fine). I don't see any point in not providing breadcrumbs for admin app - sitetree could return list of breadcrumbs, but until
sitetree_breadcrumbs
is called, nothing happen.I could provide PR with fix/change for this, but first I want to discuss the idea behind current solution.
*In version 1.5 there was simple check if app is admin app (maybe it wasn't perfect, but it was working in our case) - this simple check was as follows:
Since then, in newest version, additional check was added (notice checking app name in resolver):
The text was updated successfully, but these errors were encountered: