Show device location in breadcrumbs #9166

Closed
opened 2025-12-29 20:46:27 +01:00 by adam · 5 comments
Owner

Originally created by @llamafilm on GitHub (Jan 29, 2024).

NetBox version

v3.7.0

Feature type

Change to existing functionality

Proposed functionality

When viewing a device, the breadcrumbs at the top of the page currently show the site and parent device. I'd like to also include the location here. Mockup image:

image

Use case

My devices are primarily organized using the hierarchy Site > Location > Device. This would save a lot of time when editing a device, to be able to quickly jump to a list of other devices in the same location. (By the way, location means room name in my system).

Database changes

none

External dependencies

none

Originally created by @llamafilm on GitHub (Jan 29, 2024). ### NetBox version v3.7.0 ### Feature type Change to existing functionality ### Proposed functionality When viewing a device, the breadcrumbs at the top of the page currently show the site and parent device. I'd like to also include the location here. Mockup image: <img width="470" alt="image" src="https://github.com/netbox-community/netbox/assets/3991046/b45e4c6f-7079-4bdc-a7a1-57570a9d33af"> ### Use case My devices are primarily organized using the hierarchy Site > Location > Device. This would save a lot of time when editing a device, to be able to quickly jump to a list of other devices in the same location. (By the way, location means room name in my system). ### Database changes none ### External dependencies none
adam closed this issue 2025-12-29 20:46:27 +01:00
Author
Owner

@llamafilm commented on GitHub (Jan 29, 2024):

At first glance, it seems like all that is required is adding these lines in netbox/templates/dcim/device/base.html

  {% if object.location %}
    <li class="breadcrumb-item"><a href="{% url 'dcim:device_list' %}?site_id={{ object.site.pk }}&location_id={{ object.location.pk }}">{{ object.location }}</a></li>
  {% endif %}
@llamafilm commented on GitHub (Jan 29, 2024): At first glance, it seems like all that is required is adding these lines in `netbox/templates/dcim/device/base.html` ```html {% if object.location %} <li class="breadcrumb-item"><a href="{% url 'dcim:device_list' %}?site_id={{ object.site.pk }}&location_id={{ object.location.pk }}">{{ object.location }}</a></li> {% endif %} ```
Author
Owner

@sleepinggenius2 commented on GitHub (Jan 29, 2024):

As Locations can be nested, I would assume that the full hierarchy would be desirable, so the code would be a little more complicated. It looks like it's already being done on MPTT views themselves, like Location, Region, and Site Group, so it would probably make sense to make a template tag like the existing nested_tree one to handle this use case.

@sleepinggenius2 commented on GitHub (Jan 29, 2024): As Locations can be nested, I would assume that the full hierarchy would be desirable, so the code would be a little more complicated. It looks like it's already being done on MPTT views themselves, like Location, Region, and Site Group, so it would probably make sense to make a template tag like the existing nested_tree one to handle this use case.
Author
Owner

@llamafilm commented on GitHub (Jul 30, 2024):

You're right, the full hierarchy would be better. I guess there would need to be some limit in case the string is too long, shortening the middle with ellipses to fit on screen.

@llamafilm commented on GitHub (Jul 30, 2024): You're right, the full hierarchy would be better. I guess there would need to be some limit in case the string is too long, shortening the middle with ellipses to fit on screen.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 28, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Oct 28, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Dec 2, 2024):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Dec 2, 2024): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9166