If you're looking to hide an element in the hits widget template when a hit doesn't contain a particular attribute, you can do so by combining the ternary operator with in-line styling to hide the element.
Using the CSS display property, we hide the element when no value is present for the attribute. Here's a code example that hides the element when the hit does not contain a url attribute:
<div style=${hit.url ? '' : 'display:none'}>
<a href=${hit.url}>Click The Link!</a>
</div>
In the div style attribute, we use the ternary operator to evaluate if the hit.url is present.
If it is present, then we use empty quotes so that no in-line styling is added.
If hit.url isn't present, then we add the style 'display:none'.
display:none turns off the display of an element so that it has no effect on layout; the document is rendered as though the element did not exist. All descendant elements also have their display turned off, so in this case the <a> tag is also not displayed.