Skip to content
Snippets Groups Projects
Commit 64cce914 authored by Alexander Purr's avatar Alexander Purr Committed by Robert Lange
Browse files

refs #24409 [finc] if record has no hierarchyParentId start new Series-search on title

* origin refs 23938
parent 87dc1e81
<!-- finc: RecordDriver - DefaultRecord - data-hierarchyParentTitle --> <!-- finc: RecordDriver - DefaultRecord - data-hierarchyParentTitle -->
<?php
/**
*
* origin: self
*
* called by view helper/controller:
*
* usage:
* - Shows parent collection title in RECORD VIEW (left-hand side) under 'Teil von:'
* - Linking to parent title (default by parent-id, if missing by title-string itself)
*
* modified for finc: --
*
* configured in: --
*
**/
?>
<?php if (!empty($data)): ?> <?php if (!empty($data)): ?>
<?php $hierarchyParentId = $this->driver->tryMethod('getHierarchyParentID'); ?> <?php $hierarchyParentId = $this->driver->tryMethod('getHierarchyParentID'); ?>
<?php foreach ($data as $key => $title): ?> <?php foreach ($data as $key => $title): ?>
<?php if (isset($hierarchyParentId[$key])): ?> <?php if (isset($hierarchyParentId[$key])): ?>
<a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key], $hierarchyParentId[$key], 'ParentID');?>"><?=$this->escapeHtml($title)?></a> <a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key], $hierarchyParentId[$key], 'ParentID');?>"><?=$this->escapeHtml($title)?></a>
<?php else: ?> <?php else: ?>
<?=$this->escapeHtml($title)?> <?php /* #24409 fallback: if record has no hierarchyParentId start new Series-search on title */ ?>
<?php $url = $this->url('search-results', [], ['query'=>['type' => 'Series','lookfor' => $title]])?>
<a href="<?=$url?>"><?=$this->escapeHtml($title)?></a>
<?php endif; ?> <?php endif; ?>
<br/> <br/>
<?php endforeach; ?> <?php endforeach; ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment