<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product">
  <?
    $QRCode = $this->record($this->driver)->getQRCode("core");
    $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large'));
    $cover = $coverDetails['html'];
    $preview = $this->record($this->driver)->getPreviews();
  ?>
  <? if ($QRCode || $cover || $preview): ?>
    <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col">
      <? /* Display thumbnail if appropriate: */ ?>
      <? if($cover): ?>
        <?=$cover?>
      <? endif; ?>

      <? /* Display qrcode if appropriate: */ ?>
      <? if($QRCode): ?>
        <span class="hidden-xs">
          <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
        </span>
      <? endif; ?>

      <? // if you have a preview tab but want to move or remove the preview link
         // from this area of the record view, this can be split into
         // getPreviewData() (should stay here) and
         // getPreviewLink() (can go in your desired tab) ?>
      <? if ($preview): ?>
        <div class="record-previews">
          <?=$preview?>
        </div>
      <? endif; ?>
    </div>
  <? endif; ?>
  <div class="media-body">

    <h3 property="name"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection())?></h3>

    <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?>
    <? if ($summary): ?>
      <p><?=$this->truncate($summary, 300)?></p>

      <? if(strlen($summary) > 300): ?>
        <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p>
      <? endif; ?>
    <? endif; ?>

    <? if ($this->userlist()->getMode() !== 'disabled'): ?>
      <? /* Display the lists that this record is saved to */ ?>
      <div class="savedLists">
        <strong><?=$this->transEsc("Saved in")?>:</strong>
      </div>
    <? endif; ?>

    <?/* Display Main Details */?>
    <?
      $formatter = $this->recordDataFormatter();
      $coreFields = $formatter->getData($driver, $formatter->getDefaults('core'));
      $title_alt = $this->driver->getAlternativeTitle(); 
    ?>
    <? if (!empty($coreFields)) : ?>
      <table class="table table-striped" summary="<?=$this->transEsc('Bibliographic Details')?>">
        <?  foreach ($coreFields as $key => $current): ?>
          <?  if (strcmp($key,"Language") == 0): ?>
		<?$tr = "Language::" .$current['value'] ; ?>
		<tr><th><?=$this->transEsc($key)?>:</th><td><?=$this->translate("$tr")?></td></tr>
		<?  continue; ?>
	  <? endif; ?>
          <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr>
        <? endforeach; ?>
    <? endif; ?>
    <? if (!empty($title_alt)) : ?>	
	<tr><th><?=$this->transEsc('Alternative titles') ?></th><td>
	<?  foreach ($title_alt as $title_alt_entry): ?>
          <?=$this->transEsc($title_alt_entry);?><br>
	<? endforeach; ?>
	</td></tr>
    <? endif; ?>	
    </table>
    <?/* End Main Details */?>
  </div>
</div>
