Skip to content

Commit

Permalink
Fix uppercase record string in featured function, fix conditionals in…
Browse files Browse the repository at this point in the history
… single item partial.
  • Loading branch information
kimisgold committed Nov 17, 2020
1 parent 298a41c commit d0c54d3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
5 changes: 2 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ function foundation_random_featured_records_html($recordType)
'item' => 'items/single.php',
];

$featuredRecords = get_records(strtoupper($recordType), array('featured' => 1,
'sort_field' => 'random',
'hasImage' => $hasImage), 1);
$featuredRecords = get_records(ucfirst($recordType), array('featured' => 1,
'sort_field' => 'random'), 1);

if ($featuredRecords) {
foreach ($featuredRecords as $featuredRecord) {
Expand Down
40 changes: 20 additions & 20 deletions items/single.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<div class="item record">
<?php
$title = metadata($item, 'display_title');
$description = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 150));
$thumbnailSize = ($thumbnailSize) ? $thumbnailSize : 'thumbnail';
?>
<?php if (metadata($item, 'has files')) {
echo link_to_item(
item_image($thumbnailSize, array(), 0, $item),
array('class' => 'image'), 'show', $item
);
}
?>
<?php if ($featured): ?>
<span class="secondary label"><?php echo __('Featured Item'); ?></span>
<?php
$title = metadata($item, 'display_title');
$description = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 150));
$thumbnailSize = (isset($thumbnailSize)) ? $thumbnailSize : 'thumbnail';
?>
<?php if (metadata($item, 'has files')) {
echo link_to_item(
item_image($thumbnailSize, array(), 0, $item),
array('class' => 'image'), 'show', $item
);
}
?>
<?php if (isset($featured)): ?>
<span class="secondary label"><?php echo __('Featured Item'); ?></span>
<?php endif; ?>
<div class="record-meta">
<h3><?php echo link_to($item, 'show', $title); ?></h3>
<?php if ($description): ?>
<p class="description"><?php echo $description; ?></p>
<?php endif; ?>
<div class="record-meta">
<h3><?php echo link_to($item, 'show', $title); ?></h3>
<?php if ($description): ?>
<p class="description"><?php echo $description; ?></p>
<?php endif; ?>
</div>
</div>
</div>

0 comments on commit d0c54d3

Please sign in to comment.