Would be helpful if Custom Links page mentioned Custom Fields #5427

Closed
opened 2025-12-29 19:27:50 +01:00 by adam · 2 comments
Owner

Originally created by @HumanEquivalentUnit on GitHub (Sep 25, 2021).

Originally assigned to: @HumanEquivalentUnit on GitHub.

Change Type

Addition

Area

Functionality/features

Proposed Changes

Page custom links explains how to include object data using {{ obj.name }} but does not mention how to get data from custom fields using {{ obj.cf.custom_field }}.

That they are referenced via .cf was not obvious to me, and I stumbled on the answer in this comment on issue #6663 , where the issue raiser also thought this functionality was missing/broken.

I propose the top two paragraphs could be:

Custom links allow users to display arbitrary hyperlinks to external content within NetBox object views. These are helpful for cross-referencing related records in systems outside NetBox. For example, you might create a custom link on the device view which links to the current device in a Network Monitoring System (NMS).

Custom links are created by navigating to Customization > Custom Links. Each link is associated with a particular NetBox object type (site, device, prefix, etc.) and will be displayed on relevant views. Each link has display text and a URL, and data from the Netbox item being viewed can be included in the link using Jinja2 template code through the variable obj, and custom fields through obj.cf.

Which:

  • Includes obj.cf (is that documented anywhere else?)
  • More clearly defines NMS before using it
  • Links to Jinja2 documentation
Originally created by @HumanEquivalentUnit on GitHub (Sep 25, 2021). Originally assigned to: @HumanEquivalentUnit on GitHub. ### Change Type Addition ### Area Functionality/features ### Proposed Changes Page [custom links](https://github.com/netbox-community/netbox/blob/develop/docs/customization/custom-links.md) explains how to include object data using `{{ obj.name }}` but does not mention how to get data from custom fields using `{{ obj.cf.custom_field }}`. That they are referenced via `.cf` was not obvious to me, and I stumbled on the answer in [this comment](https://github.com/netbox-community/netbox/issues/6663#issuecomment-867884997) on issue #6663 , where the issue raiser also thought this functionality was missing/broken. I propose the top two paragraphs could be: > Custom links allow users to display arbitrary hyperlinks to external content within NetBox object views. These are helpful for cross-referencing related records in systems outside NetBox. For example, you might create a custom link on the device view which links to the current device in a Network Monitoring System (NMS). > Custom links are created by navigating to Customization > Custom Links. Each link is associated with a particular NetBox object type (site, device, prefix, etc.) and will be displayed on relevant views. Each link has display text and a URL, and data from the Netbox item being viewed can be included in the link using [Jinja2 template code](https://jinja2docs.readthedocs.io/en/stable/) through the variable `obj`, and custom fields through `obj.cf`. Which: - Includes `obj.cf` (is that documented anywhere else?) - More clearly defines NMS before using it - Links to Jinja2 documentation
adam added the status: acceptedtype: documentation labels 2025-12-29 19:27:50 +01:00
adam closed this issue 2025-12-29 19:27:50 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2021):

@HumanEquivalentUnit would you like to submit a PR to add the proposed text?

@jeremystretch commented on GitHub (Oct 6, 2021): @HumanEquivalentUnit would you like to submit a PR to add the proposed text?
Author
Owner

@HumanEquivalentUnit commented on GitHub (Oct 7, 2021):

@HumanEquivalentUnit would you like to submit a PR to add the proposed text?

I would! Pull request #7475, here.

@HumanEquivalentUnit commented on GitHub (Oct 7, 2021): > @HumanEquivalentUnit would you like to submit a PR to add the proposed text? I would! Pull request [#7475, here](https://github.com/netbox-community/netbox/pull/7475).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5427