Daniel Sheppard 6 anos atrás
pai
commit
1a1f6aff7b
1 arquivos alterados com 9 adições e 1 exclusões
  1. 9 1
      docs/additional-features/custom-links.md

+ 9 - 1
docs/additional-features/custom-links.md

@@ -24,11 +24,19 @@ 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
 For example, if you only want to display a link for active devices, you could set the link text to
 
 
 ```
 ```
-{% if device.status == 1 %}View NMS{% endif %}
+{% if obj.status == 1 %}View NMS{% endif %}
 ```
 ```
 
 
 The link will not appear when viewing a device with any status other than "active."
 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:
+
+```
+{% 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
 ## Link Groups
 
 
 You can specify a group name to organize links into related sets. Grouped links will render as a dropdown menu beneath a
 You can specify a group name to organize links into related sets. Grouped links will render as a dropdown menu beneath a