Comments (14)
I think I got it! I took all the breadcrumb.html code and replaced the include inside base.html with it and it worked. So I guess there is an issue with includes?
from bootstrap-breadcrumbs.
I think that if you only got Dashboard
than it's an ordering issue (rendering breadcrumbs list before it was fully populated), so it might be related to the way inheritance chain is setup.
from bootstrap-breadcrumbs.
I have a question while I have you. In paths where I have an ID ie. 159, would it be possible to replace that with the actual company name it represents and use it in the breadcrumb? So...
Dashboard / Accounts / ACME Inc. / Detail
If you are using Django models than you can define str() and pass model instance as $label
argument (docs) or pass any model attribute there as $label
from bootstrap-breadcrumbs.
It's been a while since I wrote any django code but I'm sure we can crack it together.
I think it's because {% render_breadcrumbs %}
is called to early. I would try moving it out of templates/base/breadcrumb.html
and into templates/base/base.html
or maybe even templates/accounts/index.html
to see if that helps.
That's the only quick tip I have right now, let me know if that still doesn't work.
from bootstrap-breadcrumbs.
Hey! Thanks for the quick reply!
I tried it in different places with same result. So confused.
from bootstrap-breadcrumbs.
🤔
I'll look into this over weekend, should be easy to reproduce
from bootstrap-breadcrumbs.
Thanks. I'll keep pluggin' away.
from bootstrap-breadcrumbs.
I have a question while I have you. In paths where I have an ID ie. 159, would it be possible to replace that with the actual company name it represents and use it in the breadcrumb? So...
From path /accountmgmt/154/detail/
Dashboard / Accounts / ACME Inc. / Detail
from bootstrap-breadcrumbs.
Ok, cool. thanks again.
from bootstrap-breadcrumbs.
Hey again.
Having a small issue I can't figure out.
I get this far
But when I select a user to view detail on, I lose the company name
Goes like this...
Dashboard: (base.html)
{% breadcrumb "Dashboard" "/dashboard" %}
Account List: (index.html)
{% extends 'base/base.html' %}
{% breadcrumb "Account List" "accountmgmt:account-list" %}
Martin's Cafe: (detail.html)
{% extends 'accounts/index.html' %}
{% breadcrumb detail.company_name|title "accountmgmt:account-detail" detail.profile_id %}
User List: (userlist.html)
{% extends 'accounts/index.html' %}
{% breadcrumb company_name|title "accountmgmt:account-detail" pid %}
{% breadcrumb "User List" "accountmgmt:user-list" pid %}
Big Boss: (userdetail.html)
{% extends 'accounts/userlist.html' %}
{% breadcrumb detail.fullname|title "accountmgmt:user-detail" detail.user_id %}
from bootstrap-breadcrumbs.
Is the detail
object the user or the company? Does that one object have all those attributes you use? (company_name
, profile_id
, user_id
)
from bootstrap-breadcrumbs.
hmmm...not likely. it would have company and profile but not user
from bootstrap-breadcrumbs.
Doesn't this mean that detail
object used when you render those breadcrumbs can't render all of those, since for some breadcrumbs it needs to be a user but for others it's a company?
I mean - when you render user page detail
object is an user object, so when partial for rendering company title gets that passed it can't find company_name
on it.
I would recommend using more meaningful object names so it's obvious what you need to pass.
from bootstrap-breadcrumbs.
Finally figured it out. Did a select_related for the account.
from bootstrap-breadcrumbs.
Related Issues (20)
- Replace GPL with a more permissive license, like BSD or MIT HOT 3
- bootstrap_for template tag does not support named view with namespace HOT 6
- kwargs are not supported? HOT 7
- add breadcrumb_raw without translation
- Make TEMPLATE_CONTEXT_PROCESSORS checks smarter or more lenient HOT 3
- named route and kwargs not respected HOT 1
- How user with Class View ? HOT 2
- Templatetag is causing 'RemovedInDjango110Warning: render() must be called with a dict, not a RequestContext.' HOT 3
- the templates aren't support to rich snippets HOT 3
- Dynamic variable to view function HOT 1
- No module named 'django.core.urlresolvers' HOT 2
- Space between slash and crumb HOT 4
- Labels are not links
- Labels translation not working
- Deprecation warnings under django-3.0 HOT 1
- No spacing after divider "/" HOT 2
- smart_text() is deprecated in favor of smart_str() HOT 3
- How to add additional html class for render_breadcrumbs?
- Templates not working as expected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-breadcrumbs.