Active
Project:
Views attach
Version:
6.x-2.2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Mar 2012 at 15:33 UTC
Updated:
6 Mar 2012 at 15:34 UTC
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>