iceman19330
asked on
tpl issue with getting an image to show
The code in question is in <!--item-pic--> I pull in the subcat field (body) from the db and I have added an image field called field_imagesc and I am trying to get it to display but I get a blank output (seen here: http://tinyurl.com/6lxhxww).
Any thoughts?
<?php
$acount = count($node->field_subcats);
if($acount == 1){
drupal_goto('node/'.$node->field_subcats[0]['nid'], NULL, NULL, NULL);
} else {
?>
<div class="subcat-content">
<div class="subcat-left">
<h1><?php print $node->title ?></h1>
<?php if(!empty($node->field_subcats['0']['view'])): ?>
<div class="item-category">
<ul>
<?php foreach($node->field_subcats as $sub): ?>
<?php $cat = node_load($sub['nid']); ?>
<li><a href="<?php print url('node/'.$cat->nid) ?>" id="#subcat-<?php print $cat->nid ?>"><?php print $cat->title ?></a></li>
<?php endforeach ?>
</ul>
</div><!--/item-category-->
<?php endif ?>
<?php if(!empty($node->field_subcats['0']['view'])): $i=0; ?>
<?php foreach($node->field_subcats as $sub): ?>
<?php $cat = node_load($sub['nid']); ?>
<div class="item-pic-<?php print $cat->nid ?>" class="item-details <?php if($i==0) print 'active' ?>">
<?php print $cat->field_imagesc[0]['view'] ?>
</div><!--/item-pic-->
<?php $i++; endforeach ?>
<?php endif ?>
</div><!--/subcat-left-->
<?php if(!empty($node->field_subcats['0']['view'])): $i=0; ?>
<?php foreach($node->field_subcats as $sub): ?>
<?php $cat = node_load($sub['nid']); ?>
<div id="subcat-<?php print $cat->nid ?>" class="subcat-details <?php if($i==0) print 'active' ?>">
<h5><a href="<?php print url('node/'.$cat->nid) ?>"><?php print $cat->title ?></a> </h5>
<?php print $cat->body ?>
<!-- <p><a href="<?php //print url('node/'.$cat->nid) ?>">View Available Inventory.</a></p>-->
</div><!--/subcat-details-->
<?php $i++; endforeach ?>
<?php endif ?>
</div><!--/subcat-content-->
<?php } ?>
Any thoughts?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER