Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
goteamkor opened this issue Sep 5, 2024 · 1 comment
Closed

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

goteamkor opened this issue Sep 5, 2024 · 1 comment
Labels
netbox type: feature Introduction of new functionality to the application

Comments

@goteamkor
Copy link

goteamkor commented Sep 5, 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.

@goteamkor goteamkor added status: needs triage This issue is awaiting triage by a maintainer type: feature Introduction of new functionality to the application labels Sep 5, 2024
@goteamkor goteamkor changed the title Allow hyperlinking/markdown in custom field choice sets Allow hyperlinking/markdown support in custom field choice sets Sep 6, 2024
@jeremystretch jeremystretch added the netbox label Nov 1, 2024 — with Linear
@jeremystretch
Copy link
Member

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 jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2025
@jeremystretch jeremystretch removed the status: needs triage This issue is awaiting triage by a maintainer label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
netbox type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants