Refreshed "additional features" docs

This commit is contained in:
Jeremy Stretch
2020-08-03 10:53:44 -04:00
parent 2e0672c2ad
commit f65ec7d509
7 changed files with 88 additions and 89 deletions

View File

@@ -1,6 +1,6 @@
# Custom Links
Custom links allow users to place arbitrary hyperlinks within NetBox views. These are helpful for cross-referencing related records in external systems. For example, you might create a custom link on the device view which links to the current device in a network monitoring system.
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 of NetBox. For example, you might create a custom link on the device view which links to the current device in a network monitoring system.
Custom links are created under the admin UI. Each link is associated with a particular NetBox object type (site, device, prefix, etc.) and will be displayed on relevant views. Each link is assigned text and a URL, both of which support Jinja2 templating. The text and URL are rendered with the context variable `obj` representing the current object.
@@ -11,7 +11,7 @@ For example, you might define a link like this:
When viewing a device named Router4, this link would render as:
```
```no-highlight
<a href="https://nms.example.com/nodes/?name=Router4">View NMS</a>
```
@@ -23,21 +23,20 @@ Only links which render with non-empty text are included on the page. You can em
For example, if you only want to display a link for active devices, you could set the link text to
```
```jinja2
{% if obj.status == 'active' %}View NMS{% endif %}
```
The link will not appear when viewing a device with any status other than "active."
Another example, if you want to only show an object of a certain manufacturer, you could set the link text to:
As another example, if you wanted to show only devices belonging to a certain manufacturer, you could do something like this:
```
{% if obj.device_type.manufacturer.name == 'Cisco' %}View NMS {% endif %}
```jinja2
{% if obj.device_type.manufacturer.name == 'Cisco' %}View NMS{% endif %}
```
The link will only appear when viewing a device with a manufacturer name of "Cisco."
## Link Groups
You can specify a group name to organize links into related sets. Grouped links will render as a dropdown menu beneath a
single button bearing the name of the group.
Group names can be specified to organize links into groups. Links with the same group name will render as a dropdown menu beneath a single button bearing the name of the group.