Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've collapsed my attached view so that you must click a link to see it. Problem is my this link shows even if there is no attached view. I would to have no link if there are no replies. Is there an IF statement I can use? Here's the code I tried within my node-content-type.tpl.php which is not working;
<a href="javascript:;" onmousedown="if(document.getElementById('mydiv').style.display == 'none'){ document.getElementById('mydiv').style.display = 'block'; }else{ document.getElementById('mydiv').style.display = 'none'; }"><p><h2>Click to see replies</h2></p></a>
<div id="mydiv" style="display:none">
<?php if ($node->content[Comments_node_content_1]['#value']): ?>
<?php print $node->content[Comments_node_content_1]['#value']; ?>
<?php endif; ?>
</div>