Giter Club home page Giter Club logo

Comments (14)

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024 1

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.

prymitive avatar prymitive commented on June 26, 2024 1

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.

prymitive avatar prymitive commented on June 26, 2024 1

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.

prymitive avatar prymitive commented on June 26, 2024

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.

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024

Hey! Thanks for the quick reply!

I tried it in different places with same result. So confused.

from bootstrap-breadcrumbs.

prymitive avatar prymitive commented on June 26, 2024

🤔
I'll look into this over weekend, should be easy to reproduce

from bootstrap-breadcrumbs.

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024

Thanks. I'll keep pluggin' away.

from bootstrap-breadcrumbs.

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024

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.

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024

Ok, cool. thanks again.

from bootstrap-breadcrumbs.

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024

Hey again.

Having a small issue I can't figure out.

I get this far

image

But when I select a user to view detail on, I lose the company name

image

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.

prymitive avatar prymitive commented on June 26, 2024

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.

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024

hmmm...not likely. it would have company and profile but not user

from bootstrap-breadcrumbs.

prymitive avatar prymitive commented on June 26, 2024

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.

KrunchMuffin avatar KrunchMuffin commented on June 26, 2024

Finally figured it out. Did a select_related for the account.

from bootstrap-breadcrumbs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.