Custom link in site page based on circuit information #9380
-
Hi all, I'm unable to find a solution for this. I manage to create custom links for circuits displayed on circuits, and custom links for sites displayed on sites. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It sounds like this is a true or false question: does a given site have any circuits of type X? If so, here's a condition you can use in your link text template to show or hide your link:
You can make this more efficient by finding the circuit type ID you want, and taking '__name' off the end of the query condition. If your type ID is 1:
|
Beta Was this translation helpful? Give feedback.
It sounds like this is a true or false question: does a given site have any circuits of type X? If so, here's a condition you can use in your link text template to show or hide your link:
{% if obj.circuit_terminations.filter(circuit__type__name='X').count() > 0 %}My Link{% endif %}
You can make this more efficient by finding the circuit type ID you want, and taking '__name' off the end of the query condition. If your type ID is 1:
{% if obj.circuit_terminations.filter(circuit__type=1).count() > 0 %}My Link{% endif %}