Allow hyperlinking/markdown support in custom field choice sets #10192

Closed
opened 2025-12-29 21:28:03 +01:00 by adam · 1 comment
Owner

Originally created by @ghost on GitHub (Sep 6, 2024).

NetBox version

v.4.1.0

Feature type

Data model extension

Proposed functionality

Allow markdown/hyperlink rendering for custom field choice sets.
I'm marking this as 'data model extension' because I imagine some tweaks to the validation will need to happen before saving the values into the database.

When creating a custom field choice set you input the value as choice1:First Choice
It would be a great feature to be able to have markdown supported in the "First Choice" side of the input such that we can turn these values into hyperlinks.

choice1:First Choice
becomes
choice1:[First Choice](https://example.com)

Use case

Adding this ability would allow custom field choice sets to be turned into URL's.
Imagine a scenario where you have a custom field called "Business Units"
You create a custom field choice set that contains all your business unit choices:

widgets:[Widgets](https://netboxurl.com/dcim/sites/?cf_business_unit=widgets)
filters:[Filters](https://netboxurl.com/dcim/sites/?cf_business_unit=filters)

What we would very likely do is craft the URL hyperlink to be a search filter for the value of that custom field so clicking on it from the objects perspective will then take you to a search query for all objects containing that value.
Similar to how you could click on a tag and it would give you all objects with that tag, same concept.

Database changes

Likely some changes here to accept markdown/hyperlinks to be stored in the value of the tablet. Don't know for sure.

External dependencies

None that I can think of.

Originally created by @ghost on GitHub (Sep 6, 2024). ### NetBox version v.4.1.0 ### Feature type Data model extension ### Proposed functionality Allow markdown/hyperlink rendering for custom field choice sets. I'm marking this as 'data model extension' because I imagine some tweaks to the validation will need to happen before saving the values into the database. When creating a custom field choice set you input the value as `choice1:First Choice` It would be a great feature to be able to have markdown supported in the "First Choice" side of the input such that we can turn these values into hyperlinks. `choice1:First Choice` becomes `choice1:[First Choice](https://example.com)` ### Use case Adding this ability would allow custom field choice sets to be turned into URL's. Imagine a scenario where you have a custom field called "Business Units" You create a custom field choice set that contains all your business unit choices: `widgets:[Widgets](https://netboxurl.com/dcim/sites/?cf_business_unit=widgets)` `filters:[Filters](https://netboxurl.com/dcim/sites/?cf_business_unit=filters)` What we would very likely do is craft the URL hyperlink to be a search filter for the value of that custom field so clicking on it from the objects perspective will then take you to a search query for all objects containing that value. Similar to how you could click on a tag and it would give you all objects with that tag, same concept. ### Database changes Likely some changes here to accept markdown/hyperlinks to be stored in the value of the tablet. Don't know for sure. ### External dependencies None that I can think of.
adam added the type: featurenetbox labels 2025-12-29 21:28:03 +01:00
adam closed this issue 2025-12-29 21:28:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 10, 2025):

Unfortunately this would be infeasible to implement given the constraints around how custom field choices are implemented: All choices need to be renderable as simple value & label pairings. This might be something to reconsider if we opt to rearchitect custom field choices in the future.

@jeremystretch commented on GitHub (Jan 10, 2025): Unfortunately this would be infeasible to implement given the constraints around how custom field choices are implemented: All choices need to be renderable as simple value & label pairings. This might be something to reconsider if we opt to rearchitect custom field choices in the future.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10192