code/pages/ExternalContentPage.php
public function view($request) {
		$object = null;
		if ($id = $request->param('ID')) {
			$object = ExternalContent::getDataObjectFor($id);
			if ($object instanceof ExternalContentSource) {
				$object = $object->getRoot();
			}

			if ($object && ($object instanceof ExternalContentItem || $object instanceof ExternalContentSource)) {
				$this->data()->setRequestedItem($object);
				$type = $object instanceof ExternalContentItem ? $object->getType() : 'source';
				$template = 'ExternalContent_' . get_class($object) . '_' . $type;

				$viewer = new SSViewer(array($template, 'ExternalContent_' . get_class($object), 'ExternalContent', 'Page'));
				$action = 'view';
				$this->extend('updateViewer', $action, $viewer);

				return $this->customise($object)->renderWith($viewer);
			}
		}

		echo "Template not found for " . ($object ? get_class($object) . ' #' . $object->ID : '');
	}
public function view($request) {
		$object = null;
		if ($id = $request->param('ID')) {
			$object = ExternalContent::getDataObjectFor($id);
			if ($object instanceof ExternalContentSource) {
				$object = $object->getRoot();
			}

			if ($object && ($object instanceof ExternalContentItem || $object instanceof ExternalContentSource)) {
				$this->data()->setRequestedItem($object);
				$type = $object instanceof ExternalContentItem ? $object->getType() : 'source';
				$template = 'ExternalContent_' . get_class($object) . '_' . $type;

				$viewer = new SSViewer(array($template, 'ExternalContent_' . get_class($object), 'ExternalContent', 'Page'));
				$action = 'view';
				$this->extend('updateViewer', $action, $viewer);

				return $this->customise($object)->renderWith($viewer);
			}
		}

		echo "Template not found for " . ($object ? get_class($object) . ' #' . $object->ID : '');
	}
public function view ( $ request ) { $ object = null ; if ( $ id = $ request -> param ( 'ID' ) ) { $ object = ExternalContent :: getDataObjectFor ( $ id ) ; if ( $ object instanceof ExternalContentSource ) { $ object = $ object -> getRoot ( ) ; } if ( $ object && ( $ object instanceof ExternalContentItem || $ object instanceof ExternalContentSource ) ) { $ this -> data ( ) -> setRequestedItem ( $ object ) ; $ type = $ object instanceof ExternalContentItem ? $ object -> getType ( ) : 'source' ; $ template = 'ExternalContent_' . get_class ( $ object ) . '_' . $ type ; $ viewer = new SSViewer ( array ( $ template , 'ExternalContent_' . get_class ( $ object ) , 'ExternalContent' , 'Page' ) ) ; $ action = 'view' ; $ this -> extend ( 'updateViewer' , $ action , $ viewer ) ; return $ this -> customise ( $ object ) -> renderWith ( $ viewer ) ; } } echo "Template not found for " . ( $ object ? get_class ( $ object ) . ' #' . $ object -> ID : '' ) ; }
Display an item.

@param HTTP_Request $request
@return String
Display an item .