support image.module thumbnail previews for bulk caption updates

dman - April 4, 2008 - 02:51
Project:Editview
Version:6.x-1.0-beta1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Thanks for the initial startup recipe! It got me going really fast considering how complex it all is.

I quickly found that it wasn't doing what I needed - I've got galleries of hundreds of images that all need captions... which is why I fecthed this. Trying to display the thumbnail just wasn't coming through. I see there's support for image-attach and imagefield, but I'm using good old image nodes!

So after an hour tracing through where it was, and where it was supposed to be (image.module adds the thumbnail in form #after_build) I figured it out.
I see you've already got a few special cases for known, non-CCK field types, so I did mine there.
Patch attached.
There's probably a slightly better way to do it - it's NOT editable, but it is at least previewable now.
Looks OK?

AttachmentSize
editview-imagenode-patch.gif27.06 KB
editview-image-node-thumbnails.patch1.23 KB

#1

dman - April 4, 2008 - 02:52
Status:active» needs review

patchy!

#2

stopbox - February 27, 2009 - 00:13

Is there any chance of a D6 version of this patch?

#3

Justin W Freeman - February 27, 2009 - 00:21

Hi stopbox,

This is definately possible.

I will add the functionality to the dev version as soon as I get a chance.

I'll post back here when it is in the dev version.

#4

stopbox - February 27, 2009 - 13:17

Thanks Agileware,

#5

stopbox - April 29, 2009 - 23:32

I have found the relevant code in the editview/theme folder (I'm just not skilled enough to know what to change!)

<?php
/**
* Implementation of hook_field_form_render().
*/
function editview_field_form_render(&$form, $field) {
 
$element = array('class' => 'editview-field', 'valign' => 'top');
  switch (
$field->field_alias) {
    default:
     
$vocab_id = str_replace('term_node_', '', $field->table_alias);
      if (
is_numeric($vocab_id)) {
       
$element['data'] = drupal_render($form['taxonomy'][$vocab_id]);
      }
      else {
       
// If the field is a cck field, send throught the right identifier.
       
if ($field->content_field['field_name']) {
         
$element['data'] = _editview_form_field($form, $field->content_field['field_name']);
        }
        else {
         
$element['data'] = _editview_form_field($form, $field->field);
        }
      }
      break;
  }
  return
$element;
}
?>

#6

stopbox - May 5, 2009 - 12:29
Version:5.x-0.3» 6.x-1.0-beta1
Status:needs review» needs work

Is I don't think this made it into Beta 1, is there any chance you could take a look?

#7

Justin W Freeman - May 6, 2009 - 02:41

Oops sorry about that. Will get it in really soon.

 
 

Drupal is a registered trademark of Dries Buytaert.