diff --git a/docs/plugins/development/templates.md b/docs/plugins/development/templates.md index 64616c4427..20838149fb 100644 --- a/docs/plugins/development/templates.md +++ b/docs/plugins/development/templates.md @@ -215,6 +215,8 @@ The following custom template tags are available in NetBox. ::: utilities.templatetags.builtins.tags.checkmark +::: utilities.templatetags.builtins.tags.customfield_value + ::: utilities.templatetags.builtins.tags.tag ## Filters diff --git a/docs/release-notes/version-3.3.md b/docs/release-notes/version-3.3.md index ea9e67a389..f5cb8eee19 100644 --- a/docs/release-notes/version-3.3.md +++ b/docs/release-notes/version-3.3.md @@ -40,6 +40,7 @@ * [#9075](https://github.com/netbox-community/netbox/issues/9075) - Introduce `AbortRequest` exception for cleanly interrupting object mutations * [#9092](https://github.com/netbox-community/netbox/issues/9092) - Add support for `ObjectChildrenView` generic view * [#9414](https://github.com/netbox-community/netbox/issues/9414) - Add `clone()` method to NetBoxModel for copying instance attributes +* [#9647](https://github.com/netbox-community/netbox/issues/9647) - Introduce `customfield_value` template tag ### Other Changes diff --git a/netbox/templates/inc/panels/custom_fields.html b/netbox/templates/inc/panels/custom_fields.html index b18d440301..90059447f3 100644 --- a/netbox/templates/inc/panels/custom_fields.html +++ b/netbox/templates/inc/panels/custom_fields.html @@ -16,33 +16,7 @@ {{ field }}
{{ value|json }}
- {% elif field.type == 'multiselect' and value %}
- {{ value|join:", " }}
- {% elif field.type == 'object' and value %}
- {{ value|linkify }}
- {% elif field.type == 'multiobject' and value %}
- {% for obj in value %}
- {{ obj|linkify }}{% if not forloop.last %}{{ value|json }}
+{% elif field.type == 'multiselect' and value %}
+ {{ value|join:", " }}
+{% elif field.type == 'object' and value %}
+ {{ value|linkify }}
+{% elif field.type == 'multiobject' and value %}
+ {% for object in value %}
+ {{ object|linkify }}{% if not forloop.last %}