<?php if ($content['field_banner']): ?>
开发者_如何学JAVA <div class="proj"><?php print render($content['field_banner']) ?></div>
<?php endif; ?>
My if condition is not working, if the page doesn't have banner, i am getting an error: Notice: Undefined index: field_banner in include() (line 28 of node.tpl.php
Maybe a little isset() can make the difference.
<?php if (isset($content['field_banner'])): ?>
精彩评论