Hi,
I'm having difficulty achieving some output using the Contemplate module - hope somebody can help out.
I'm using CCK, imagecache and contemplate to produce a 'case study' content type. The teaser view page has been customised using Contemplate module, inserting a thumbnail image created by Imagecache module (namespace of 'focuson').
The code is outputing markup for the image thubnail even if the imagefiled ($field_focus_on_thumb) is empty. How do I create an array for only items that have the used the imagefiled ($field_focus_on_thumb)?
code:
<?php foreach ((array)$field_focus_on_thumb as $item) { ?> <div class="field field-type-image field-field-focus-on-thumb"> <div class="field-items"> <div class="field-item"> <img src="<?php print $GLOBALS['base_url'] ?>/files/imagecache/focuson/<?php print $item['filepath'] ?>" alt="<?php print $item['alt'] ?>" title="<?php print $item['title'] ?>"> </div> </div> </div> <?php } ?>
<div class="field field-type-text field-field-teaser-text"> <div class="field-items"> <?php foreach ((array)$field_teaser_text as $item) { ?> <div class="field-item"><?php print $item['view'] ?></div> <?php } ?> </div> </div> <div class="links"><a class="read-more" href="/<?php print $path ?>">read more</a> »</div>
Thanks Mark