# --- object id/representation of related image to cue slideshow to
$pn_object_rep_id = $this->request->getParameter("id", pInteger);
# --- array of images to display
$va_images = array();
# --- get related object_ids in array
$va_objects = $t_item->get("ca_objects", array("returnAsArray" => true, "checkAccess" => $va_access_values));
$va_object_ids = array();
if (is_array($va_objects) && sizeof($va_objects)) {
    foreach ($va_objects as $va_object) {
        $va_object_ids[] = $va_object["object_id"];
    }
    if (in_array($ps_view, array("images", "thumbnails"))) {
        $q_objects = caMakeSearchResult('ca_objects', $va_object_ids);
        if ($q_objects->numHits()) {
            while ($q_objects->nextHit()) {
                $va_images[$q_objects->get("object_id")] = array("image" => $q_objects->get("ca_object_representations.media.mediumlarge"), "thumbnail" => $q_objects->get("ca_object_representations.media.thumbnail300square"), "id" => $q_objects->get("object_id"), "label" => sefaFormatCaption($this->request, $q_objects));
            }
        }
    }
}
# --- representations related with type depicts are installation shots
$va_rep_install_ids = $t_item->get("ca_object_representations.representation_id", array("checkAccess" => $va_access_values, "restrictToRelationshipTypes" => array("depicts"), "returnAsArray" => true));
if (in_array($ps_view, array("installations", "installationThumbnails"))) {
    if (is_array($va_rep_install_ids) && sizeof($va_rep_install_ids)) {
        $o_representations = $t_item->getRepresentationsAsSearchResult(array("checkAccess" => $va_access_values));
        if ($o_representations->numHits()) {
            while ($o_representations->nextHit()) {
                if (in_array($o_representations->get("representation_id"), $va_rep_install_ids)) {
                    $va_images[$o_representations->get("representation_id")] = array("image" => $o_representations->get("ca_object_representations.media.mediumlarge"), "thumbnail" => $o_representations->get("ca_object_representations.media.thumbnail300square"), "id" => $o_representations->get("representation_id"), "label" => $o_representations->get("ca_object_representations.preferred_labels.name"));
                }
            }
<?php 
switch ($ps_view) {
    case "info":
    default:
        ?>
		
			
			<div class="thumbnail thumbnailImgLeft">
<?php 
        $va_objects = $t_item->get("ca_objects", array("restrictToRelationshipTypes" => array("used_website"), "returnAsArray" => true, "checkAccess" => $va_access_values));
        foreach ($va_objects as $va_object) {
            $t_object = new ca_objects($va_object["object_id"]);
            print $t_object->get("ca_object_representations.media.mediumlarge");
            ?>
					<div class="caption"><?php 
            print sefaFormatCaption($this->request, $t_object);
            ?>
</div>
<?php 
        }
        ?>
			</div> <!--end thumbnail-->
				<p>
					<h1>{{{ca_occurrences.preferred_labels.name}}}</h1>
					{{{<ifdef code="ca_occurrences.exhibition_subtitle">
						<h2>^ca_occurrences.exhibition_subtitle</h2>
					</ifdef>}}}
					<h4>{{{^ca_occurrences.opening_closing}}}{{{<ifdef code="ca_occurrences.opening_reception"> | Opening Reception: ^ca_occurrences.opening_reception</ifdef>}}}</h4>
					{{{^ca_occurrences.description}}}
				</p>
				<br/><strong>
				</div><!-- end col -->
			</div><!-- end row -->
<?php 
        break;
        # ----------------------------------------------
    # ----------------------------------------------
    case "works":
    default:
        $q_objects = caMakeSearchResult('ca_objects', $va_object_ids);
        if ($q_objects->numHits()) {
            $va_images = array();
            while ($q_objects->nextHit()) {
                $vs_image = "";
                $vs_image = $q_objects->get("ca_object_representations.media.mediumlarge", array("checkAccess" => $va_access_values));
                if ($vs_image) {
                    $va_images[] = array("image" => $vs_image, "caption" => sefaFormatCaption($this->request, $q_objects));
                }
            }
            ?>
					<div class="jcarousel-wrapper">
						<!-- Carousel -->
						<div class="jcarousel">
							<ul>
<?php 
            $vn_i = 1;
            foreach ($va_images as $va_image) {
                ?>
								<li id="slide<?php 
                print $q_objects->get("object_id");
                ?>
">