Assorted Geekery

Drupal – Getting cover images for mixed Gallery Assist and non-GA nodes in views

[code] $VarNodeTaxmy = $fields[‘tid’]->content; $VarNodeTitle = $fields[‘title’]->content; $VarNodeTeasr = $fields[‘teaser’]->content; $VarNodeDate = $fields[‘created’]->content; $VarNodeType = $fields[‘type’]->content; $VarNodeDepth = $fields[‘depth’]->content; IF ($fields[‘type’]->content == ‘Gallery’) { $VarNodeImage = $fields[‘cover’]->content; } ELSE //non gallary nodes { foreach ($fields as $id => $field): if ($field->class == ‘field-main-image-fid’) { $VarNodeImage = $field->content; } endforeach; } […]