Skip to content

Instantly share code, notes, and snippets.

@chadsten
Last active December 19, 2015 00:49
Show Gist options
  • Select an option

  • Save chadsten/5871338 to your computer and use it in GitHub Desktop.

Select an option

Save chadsten/5871338 to your computer and use it in GitHub Desktop.
<?
$node_type = strtolower(GET_NODE_MACHINE_NAME); // easy and optional
$entities = entity_load('node', array($row->field_photo)); // node, or any other entity type
$uri = $entities[$row->field_photo]->field_photo['und'][0]['uri'];
$layout = strtolower(taxonomy_term_load($entities[$row->field_photo]->field_layout['und'][0]['tid'])->name);
return image_style_url($node_type . "_" . $layout, $uri);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment