-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom-solr-metadata--series-naelp.tpl.php.bak
64 lines (59 loc) · 2.3 KB
/
custom-solr-metadata--series-naelp.tpl.php.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* DISABLED because we no longer call the theme function directly from the series objects.
* so it wouldn't be called anyway. Removed for posterity and to remove confusion.
*
*/
/**
* @file islandora-solr-grid.tpl.php
* Islandora solr primary results template file for
*
* Variables available:
* - $variables: all array elements of $variables can be used as a variable. e.g. $base_url equals $variables['base_url']
* - $base_url: The base url of the current website. eg: http://example.com/drupal .
* - $user: The user object.
* - $solr_default_img: default solr image. Used when no thumbnail is available.
*
* - $results: Primary profile results array
*
* @see template_preprocess_islandora_solr()
*/
?>
<?php if (empty($results)): ?>
<p class="no-results"><?php print t('Sorry, but your search returned no results.'); ?></p>
<?php else: ?>
<div class="islandora islandora-solr-search-results">
<?php $row_result = 0; ?>
<?php foreach($results as $result): ?>
<!-- Search result -->
<div class="islandora-solr-search-result clear-block <?php print $row_result % 2 == 0 ? 'odd' : 'even'; ?>">
<!-- PID -->
<?php $PID = $result['PID'];?>
<!-- Thumbnail -->
<dl class="solr-thumb">
<dt>
<?php $image = '<img src="' . $result['thumbnail_url'] . '" />'; ?>
<?php print l($image, $result['object_url'] , array('html' => TRUE)); ?>
</dt>
<dd></dd>
</dl>
<!-- Metadata -->
<div class="solr-fields islandora-inline-metadata">
<?php $row_field = 0; ?>
<?php $max_rows = count($results[$row_result]) - 1; ?>
<?php foreach($result['solr_doc'] as $key => $value): ?>
<?php if ($key == 'title' or $key == 'more'): ?>
<?php $value['value'] = l($value['value'], $result['object_url'], array('html' => TRUE)); ?>
<?php endif; ?>
<?php if ($key == 'volume') continue; ?>
<div class="solr-value <?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?><?php print $row_field == $max_rows ? ' last' : ''; ?>">
<?php print $value['label'] . ' ' . $value['value']; ?>
</div>
<?php $row_field++; ?>
<?php endforeach; ?>
</div>
</div>
<?php $row_result++; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>