Access to Config Context from Custom Link #6997

Closed
opened 2025-12-29 19:47:36 +01:00 by adam · 3 comments
Owner

Originally created by @tomasherout on GitHub (Sep 19, 2022).

NetBox version

v.3.3.4

Feature type

New functionality

Proposed functionality

Custom Link has access to Custom Fields via {{ object.cf.foo }} but seems it can't access to Config Context of particular device.

Use case

Provide link to other systems where related data are stored in Config Context.

Database changes

No response

External dependencies

No response

Originally created by @tomasherout on GitHub (Sep 19, 2022). ### NetBox version v.3.3.4 ### Feature type New functionality ### Proposed functionality _Custom Link_ has access to _Custom Fields_ via `{{ object.cf.foo }}` but seems it can't access to _Config Context_ of particular device. ### Use case Provide link to other systems where related data are stored in Config Context. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 19:47:36 +01:00
adam closed this issue 2025-12-29 19:47:36 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Sep 19, 2022):

It works for me when testing:

{{object.get_config_context().name_of_key}}

@kkthxbye-code commented on GitHub (Sep 19, 2022): It works for me when testing: `{{object.get_config_context().name_of_key}}`
Author
Owner

@tomasherout commented on GitHub (Sep 19, 2022):

Cool, works. Many thanks 👍

It would be good to mention it at https://docs.netbox.dev/en/stable/customization/custom-links/

@tomasherout commented on GitHub (Sep 19, 2022): Cool, works. Many thanks 👍 It would be good to mention it at https://docs.netbox.dev/en/stable/customization/custom-links/
Author
Owner

@kkthxbye-code commented on GitHub (Sep 19, 2022):

I think it's a hard balance, as we already mention the following:

Checking the REST API representation of an object is generally a convenient way to determine what attributes are available. You can also reference the NetBox source code directly for a comprehensive list.

Custom scripts, reports, custom URL's etc. are really all power user features and it's impossible to document everything that is possible with the internal netbox objects. If you feel like config contexts deserves a concrete mention in the docs you are welcome to create a documentation issue instead.

@kkthxbye-code commented on GitHub (Sep 19, 2022): I think it's a hard balance, as we already mention the following: >Checking the REST API representation of an object is generally a convenient way to determine what attributes are available. _**You can also reference the NetBox source code directly for a comprehensive list.**_ Custom scripts, reports, custom URL's etc. are really all power user features and it's impossible to document everything that is possible with the internal netbox objects. If you feel like config contexts deserves a concrete mention in the docs you are welcome to create a documentation issue instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6997