Hi there, just came accross this module a few hours ago while researching moving from image/image_attach, and this seems to fit the bill.

However one of the reasons I want to move to imagefield is to allow multiple image nodes with different permissions. Would it be possible to have like a checkbox approach to selecting the image node type instead of a drop down?

Also, can the nodereference widget be altered to show a thumbnail of the referenced node, like it is done with image_attach?

Otherwise, great module!

Comments

bibo’s picture

I haven't even installed this module yet, but I'm going to (looks very promising, hoping this is more stable and light than http://drupal.org/project/nodereference_explorer - which is also promising).

But, to answer your third question:

Also, can the nodereference widget be altered to show a thumbnail of the referenced node, like it is done with image_attach?

Yes it can, with a theme override :). This is how I did it:

First copy "/modules/cck/theme/content-field.tpl.php" to your theme folder. Then copy it *again* to the theme folder, but with a different name, which is
"content-field-[NAME_OF_YOUR_FIELD].tpl.php". In my case the filename was "content-field-field_kuvaviittaus.tpl.php";

Then alter the file to look something like this. You need to change at least:

field_kuvaviittaus --> name of the node reference field
field_kuva --> name of the imagefield in the referenced node
hs_default --> name of the highslide settings that determines which imagecache presets to use

Also, I used highslide_field_formatter(), which is a function of the highslide-module (excellent JS imageviewer),
which is similar to lightbox, shadowbox, thickbox etc. If you use another method for viewing the image,
check the theming functions of those modules. Yeah, it can get complicated, but it's very flexible.

Here how my "content-field-field_kuvaviittaus.tpl.php" looks like (starting and ending with ###):

################################

// $Id: content-field.tpl.php,v 1.1.2.5 2008/11/03 12:46:27 yched Exp $

/**
 * @file content-field.tpl.php
 * Default theme implementation to display the value of a field.
 *
 * Available variables:
 * - $node: The node object.
 * - $field: The field array.
 * - $items: An array of values for each item in the field array.
 * - $teaser: Whether this is displayed as a teaser.
 * - $page: Whether this is displayed as a page.
 * - $field_name: The field name.
 * - $field_type: The field type.
 * - $field_name_css: The css-compatible field name.
 * - $field_type_css: The css-compatible field type.
 * - $label: The item label.
 * - $label_display: Position of label display, inline, above, or hidden.
 * - $field_empty: Whether the field has any valid value.
 *
 * Each $item in $items contains:
 * - 'view' - the themed view for that item
 *
 * @see template_preprocess_field()
 */
 

if (!$field_empty) :

print $field_type_css field- print $field_name_css ">

  if ($label_display == 'above') : 
print t($label)

endif;

	foreach($node->field_kuvaviittaus as $value){
		if(is_numeric($value['nid'])){
			$image_node = node_load($value['nid']);
			
			if(is_array($image_node->field_kuva)){
				foreach($image_node->field_kuva as $kuvakey => $kuva){
				
					$field = 'field_kuva';
					$item = $kuva;
					$formatter = 'hs_default';
					
					if(function_exists('highslide_field_formatter')){
						$content .= highslide_field_formatter($field, $item, $formatter, $image_node);
					}else{
						// WTF! No highslide image?
						$content .= t("The image could not be retrieved.");
					}					
				}
			}
		}
	}
	
	echo $content;

	

endif;

?>
################################

This overrides only the normal nodeview. To override it for Views (when you add the nodereference field) you need another theme file with a very different structure.

flk’s picture

Category: feature » support
Status: Active » Closed (fixed)

This module does what you ask, if the image preview is not showing up make sure to select the right field in the settings page.
:/admin/settings/noderef_image_helper

naheemsays’s picture

the image preview is showing up for me - the widget problem was slightly bogus.

but the main issue I was asking about still exists - in admin/settings/noderef_image_helper you can only select one node as the image node type.

I would like the option to select multiple node types from there (I have two separate image node types used for different purposes, one of them general, the other one not.)