Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's hard to moderate CCK-fields with images as there are no previews for them.
For 6.x-1.3 I've done it by replacing
'#value' => $teaser,
on 256-th line of modr8_admin.inc with
'#value' => $teaser.theme('imagecache', 'name-of-imagecache-preset', $node->field_custom-cck-field[0]['filepath'], $alt = $altimg, $title = $titleimg, $attributes=null), // preview hack
where name-of-imagecache-preset is user-defined imagecache preset (can be viewed and added on /admin/build/imagecache ) and field_custom-cck-field is CCK field, can be added on /admin/content/node-type/custom-name/fields.
Comments
Comment #1
geneatwell CreditAttribution: geneatwell commentedThanks for this hack! It works just fine with a single custom CCK image field, but I have two different CCK image fields (field_custom_cck1 and field_custom_cck2) that need to be previewed. Each node will have one or the other image field, but never both. How would I preview the correct one using the above example? I do not know PHP and my searches have not led me to an answer. Thanks in advance.
Comment #2
geneatwell CreditAttribution: geneatwell commentedTried the following and it did not work.
$form[$node->nid]['preview'] = array(
'#type' => 'value',
if (empty($node->field_newspaper_photo)) {
'#value' => $teaser.theme('imagecache', 'gallery-cover', $node->field_photo[0]['filepath'], $alt = $altimg, $title = $titleimg, $attributes=null);
} else {
'#value' => $teaser.theme('imagecache', 'gallery-cover', $node->field_newspaper_photo[0]['filepath'], $alt = $altimg, $title = $titleimg, $attributes=null);
}, // preview hack
Comment #3
int_ua CreditAttribution: int_ua commentedTry to
print_r($node);
before using $node->field_...
And see what is present in different situations.
Comment #4
geneatwell CreditAttribution: geneatwell commentedSame thing happens when I try to add the php. I've used Firebug to trace the correct variables.
Comment #5
fugazi CreditAttribution: fugazi commentedYou can also leave this show with lightbox second I've searched but unfortunately I'm not porgramierer and do not know how to write this. Maybe a tip?