First, thank you very much for this great module!
It is very powerful and helped me to simplify my views structure.
Nice job!!

May I ask you a php related question?
Due my lack of php knowledge I am not sure how to access the values within the "data" field of my image_fields.

I a where able to access the rendered image itself with:

$static = $this->view->display_handler->get_handlers('field');
if (!empty($static['field_image_craft_fid']->last_render)) {
   echo $static['field_image_craft_fid']->last_render;
} else {
   echo $static['field_primary_image_fid']->last_render;
}

But in a different case, I would also like to get within "data":
image_title
image_caption
image_source

node_data_field_primary_image_field_primary_image_fid (Array, 10 elements)
	0 (Array, 3 elements)
	fid (String, 1 characters ) 3
	list (String, 1 characters ) 1
	data (String, 526 characters ) a:7:{s:11:"image_title";a:3:{s:4:"body";s:0:"";...
		a:7:{s:11:"image_title";a:3:{s:4:"body";s:0:"";s:6:"format";s:0:"";s:5:"style";s:9:"textfield";}s:13:"image_caption";a:3:{s:4:"body";s:97:"First Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.";s:6:"format";s:0:"";s:5:"style";s:8:"textarea";}s:12:"image_source";a:3:{s:4:"body";s:48:"Name Placeholder 1, Insitution Placeholder, 2010";s:6:"format";s:0:"";s:5:"style";s:8:"textarea";}s:10:"focus_rect";s:0:"";s:9:"crop_rect";s:0:"";s:3:"alt";s:0:"";s:5:"title";s:14:"First Creation";}

Maybe I have to build a proper array, but I am not sure how to do so.
Thank you for any hints!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fourmi4x’s picture

I have exactly the same problem... Did you manage to do this?

I also tried Passing Replacement Patterns no PHP code, but without success...

stefan81’s picture

Hi

Here a few examples:

print $node->field_primary_image[$count]['data']['image_caption']['body'] 
print $node->field_primary_image[$count]['data']['image_source']['body']

field_primary_image is my image field.
'image_caption' and 'image_source' are my extra fields

hope this helps

fourmi4x’s picture

Hi, thanks for your answer. But for this snippet to work, I would have to do a node_load... ?