ImageFieldを使用して表示画像サイズをコントロールするにはImagecacheを使用
Posted: 6月 22nd, 2009 | Author: admin | Filed under: drupal | Tags: ImageCache, ImageFiled | 4 Comments »Imagefieldには表示画像サイズをコントロールする機能はない。よってその場合はimagecacheを利用する。
viewもしくはCCKの場合はdisplay fieldsを調整すればそれで終了だが、coontentemplatesなどを使った場合はマニュアルでセットする必要がある。その場合は、
<?php
print theme('imagecache', $preset, $image['filepath'], $alt, $title, $attributes);
?>
や
<?php if ($field_images[0]['view'] > '' ) : ?>
<?php foreach($field_images as $item) { ?>
<div class="images">
<?php print '<img src="/files/imagecache/medium/'.$item['filepath'].'" title="'.$item['title'].'" alt="'.$item['alt'].'">'; ?>
<?php print '<h3 class="img_title">'.$item['title'].'</h3>'; ?>
</div>
<?php } ?>
<?php endif; ?>
のようにする
