- Code: Select all
<div class="content clear-block">
<div class="single_image_right">
<div class="thumb t<?php print $node->field_single_img_align[0]['value']; ?>">
<div class="thumbinner" style="width: <?php print ($imgsz + 2); ?>px;">
<a class="image" title="<?php print $img_alt; ?>" href="<?php print $clink; ?>">
<img class="thumbimage" width="<?php print $imgsz; ?>" src="<?php print $node->field_single_img_link[0]['value']; ?>" alt="<?php print $img_alt; ?>"/>
</a>
<div class="thumbcaption">
<?php print $node->field_single_img_caption[0]['value']; ?>
</div>
</div>
</div>
</div>
</div>
Now I've gone in and replaced it with some values to get this:
- Code: Select all
<div class="content clear-block">
<div class="single_image_right">
<div class="thumb t<?php print $item['view'] ?>">
<div class="thumbinner" style="width: <?php print ($item['view']+ 2); ?>px;">
<img class="thumbimage" src="<?php print $item['view']; ?>" />
<div class="thumbcaption">
<?php if ($item['data']['title']): ?>
<?php print $item['data']['title']; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
which won't print the image (nor can I get the image width).
The default Drupal template I'm working with is what gave me the fields to work into the original code:
- Code: Select all
<?php if (!$field_empty) : ?>
<div class="field field-type-<?php print $field_type_css ?> field-<?php print $field_name_css ?>">
<?php if ($label_display == 'above') : ?>
<div class="field-label"><?php print t($label) ?>: </div>
<?php endif;?>
<div class="field-items">
<?php $count = 1;
foreach ($items as $delta => $item) :
if (!$item['empty']) : ?>
<div class="field-item <?php print ($count % 2 ? 'odd' : 'even') ?>">
<?php if ($label_display == 'inline') { ?>
<div class="field-label-inline<?php print($delta ? '' : '-first')?>">
<?php print t($label) ?>: </div>
<?php } ?>
<div class="imagecache_image">
<?php print $item['view'] ?>
<div class="image-caption">
<?php if ($item['data']['title']): ?>
<?php print $item['data']['title']; ?>
<?php endif; ?>
</div>
</div>
</div>
<?php $count++;
endif;
endforeach;?>
</div>
</div>
<?php endif; ?>
Any ideas of how to get the image to print? This is what Chrome's Inspector shows me when I click on the blank space where the image should be has spaces where the forward slashes should be!

