From d80a2de81a8ea8720328dcf53d3f4737b7eaa0e9 Mon Sep 17 00:00:00 2001
From: Claas Kazzer <kazzer@ub.uni-leipzig.de>
Date: Tue, 4 Sep 2018 15:47:01 +0200
Subject: [PATCH] refs #13924 * fixes Lido schema tagging in finc

---
 themes/finc/templates/RecordDriver/SolrLido/core.phtml      | 3 ++-
 .../finc/templates/RecordDriver/SolrLido/data-authors.phtml | 6 ++++--
 themes/finc/templates/RecordTab/description.phtml           | 4 +++-
 themes/finc/templates/RecordTab/descriptionlido.phtml       | 4 ++++
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/themes/finc/templates/RecordDriver/SolrLido/core.phtml b/themes/finc/templates/RecordDriver/SolrLido/core.phtml
index 3ade8f8e601..269dddf05df 100644
--- a/themes/finc/templates/RecordDriver/SolrLido/core.phtml
+++ b/themes/finc/templates/RecordDriver/SolrLido/core.phtml
@@ -1,4 +1,5 @@
 <!-- finc: RecordDriver - solrLido - core -->
+<? /* keep schema tagging here in finc - CK, #13861 */ ?>
 <div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product">
   <?
     if ($loggedin = $this->auth()->isLoggedIn()) {
@@ -56,7 +57,7 @@
   <div class="media-body">
 
     <? /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars
-          remove schema name tag here but keept in description, CK
+      in finc: keep schema name tag here!! #13861 CK
        */
     ?>
     <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3>
diff --git a/themes/finc/templates/RecordDriver/SolrLido/data-authors.phtml b/themes/finc/templates/RecordDriver/SolrLido/data-authors.phtml
index 40edc71cce8..0adb2a0e98e 100644
--- a/themes/finc/templates/RecordDriver/SolrLido/data-authors.phtml
+++ b/themes/finc/templates/RecordDriver/SolrLido/data-authors.phtml
@@ -14,10 +14,12 @@ $formattedAuthors = [];
 <? if (!empty($data[$type])): ?>
     <? foreach ($data[$type] as $author => $roles): ?>
         <? ob_start(); ?>
-        <span class="author-data" property="<?=$this->escapeHtml($schemaLabel)?>">
+        <span class="author-data" property="<?=$this->escapeHtml($schemaLabel)?>" typeof="Person">
+    <span property="name">
         <a href="<?=$this->record($this->driver)->getLink('author', $author)?>">
           <?=$this->escapeHtml($author)?>
         </a>
+    </span>
             <?
             // Display additional data using the appropriate translation prefix
             // (for example, to render author roles correctly):
@@ -28,7 +30,7 @@ $formattedAuthors = [];
                     // deprecated due to more flexible solution at core
                     // to-do: revision of indexing and finc specific treatment
                     // of roles in RecordDriver
-                    if (count($roles) > 0 && $name == 'roles') {
+                    if (count($roles) > 0 && $name == 'role') {
                         echo $formatProperty($roles, $name, $prefix);
                     }
                 }
diff --git a/themes/finc/templates/RecordTab/description.phtml b/themes/finc/templates/RecordTab/description.phtml
index 8420678662f..9b5e646b2b2 100644
--- a/themes/finc/templates/RecordTab/description.phtml
+++ b/themes/finc/templates/RecordTab/description.phtml
@@ -6,8 +6,10 @@ $this->headTitle($this->translate('Description') . ': ' . $this->driver->getBrea
 $formatter = $this->recordDataFormatter();
 $mainFields = $formatter->getData($driver, $formatter->getDefaults('description'));
 ?>
+<? /* finc: remove schema tag here but keep in core,*/ ?>
 <table class="table table-striped">
-  <? /* finc: table summary not supported in html 5, finc-specific solution, CK */ ?>
+  <? /* finc: table summary not supported in html 5, finc-specific solution, CK */
+  /* Table gets filled via recordDriver/.../data-... templates as referenced in RecordDataFormatterFactory */ ?>
   <caption class="sr-only"><?=$this->transEsc('Description')?></caption>
   <? if (!empty($mainFields)): ?>
     <? foreach ($mainFields as $key => $current): ?>
diff --git a/themes/finc/templates/RecordTab/descriptionlido.phtml b/themes/finc/templates/RecordTab/descriptionlido.phtml
index 61dd9b6cb8e..d0a90d804ad 100644
--- a/themes/finc/templates/RecordTab/descriptionlido.phtml
+++ b/themes/finc/templates/RecordTab/descriptionlido.phtml
@@ -6,6 +6,10 @@ $this->headTitle($this->translate('Description') . ': ' . $this->driver->getBrea
 $formatter = $this->recordDataFormatter();
 $mainFields = $formatter->getData($driver, $formatter->getDefaults('description-lido'));
 ?>
+<? /*
+ This next table originally in table "Display Main Details" in solrDefault - core templates, compare with core and with description.phtml! CK
+ /* finc: remove schema tag here but keep in core,*/
+?>
 <table class="table table-striped">
   <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?>
   <caption class="sr-only"><?= $this->transEsc('Description') ?></caption>
-- 
GitLab