From 572925fa15057ec0160ae6aaac4f5b0ceef259e3 Mon Sep 17 00:00:00 2001
From: Gregor Gawol <gawol@ub.uni-leipzig.de>
Date: Fri, 4 Sep 2020 13:57:17 +0200
Subject: [PATCH] refs #18214 [master] allsubjects * added additional template

---
 .../data-allSubjectHeadingsWithExtended.phtml  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 themes/finc/templates/RecordDriver/SolrMarc/data-allSubjectHeadingsWithExtended.phtml

diff --git a/themes/finc/templates/RecordDriver/SolrMarc/data-allSubjectHeadingsWithExtended.phtml b/themes/finc/templates/RecordDriver/SolrMarc/data-allSubjectHeadingsWithExtended.phtml
new file mode 100644
index 00000000000..29a5cdbf143
--- /dev/null
+++ b/themes/finc/templates/RecordDriver/SolrMarc/data-allSubjectHeadingsWithExtended.phtml
@@ -0,0 +1,18 @@
+<!-- finc: RecordDriver - solrMarc data-allSubjectHeadingsWithExtended -->
+<?php if(!empty($data)): ?>
+    <?php foreach ($data as $field): ?>
+    <div class="subject-line" property="keywords">
+        <?php $subject = ''; ?>
+        <?php if(count($field) == 1 && !isset($field['subject'])) $field = explode('--', $field[0]); ?>
+        <?php if(isset($field['subject'])): // extended topics ?>
+            <?php $field = $field['subject']; ?>
+        <?php endif; ?>
+        <?php $i = 0; foreach ($field as $subfield): ?>
+            <?=($i++ == 0) ? '' : ' &gt; '?>
+            <?php $subject = trim($subject . ' ' . $subfield); ?>
+          <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a>
+        <?php endforeach; ?>
+    </div>
+    <?php endforeach; ?>
+<?php endif; ?>
+<!-- finc: RecordDriver - solrMarc data-allSubjectHeadingsWithExtended - END -->
-- 
GitLab