Posted by int_ua on May 13, 2011 at 9:33am
3 followers
Jump to:
| Project: | modr8 |
| Version: | 6.x-1.3 |
| Component: | User interface |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | moderation page, preview |
Issue Summary
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
#1
Thanks 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.
#2
Tried 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
#3
Try to
print_r($node);before using $node->field_...
And see what is present in different situations.
#4
Same thing happens when I try to add the php. I've used Firebug to trace the correct variables.
#5
You 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?