getObjectEntity(); // Get images related to this batch $images = elgg_get_entities_from_relationship(array( 'relationship' => 'belongs_to_batch', 'relationship_guid' => $batch->getGUID(), 'inverse_relationship' => true, 'type' => 'object', 'subtype' => 'image', 'offset' => 0, )); $album = $batch->getContainerEntity(); if (!$album) { // something went quite wrong - this batch has no associated album return true; } $album_link = elgg_view('output/url', array( 'href' => $album->getURL(), 'text' => $album->getTitle(), 'is_trusted' => true, )); $subject = $vars['item']->getSubjectEntity(); $subject_link = elgg_view('output/url', array( 'href' => $subject->getURL(), 'text' => $subject->name, 'class' => 'elgg-river-subject', 'is_trusted' => true, )); if (count($images)) { $attachments = '