Skip to content

Commit

Permalink
minor/misc form revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
ebellempire committed Apr 2, 2024
1 parent 623093e commit 5aabeb9
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions views/public/tours/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,41 @@
foreach( $tour->getItems() as $tourItem ):
if($tourItem->public || current_user()){
set_current_record( 'item', $tourItem );
$itemID=$tourItem->id;
$more='<a href="/items/show/'.$tourItem->id.'">'.__('Learn more').'</a>';
$item_image=null;
$more='<a class="ti-more" href="/items/show/'.$tourItem->id.'">'.__('Learn more').'</a>';
$hasImage=metadata($tourItem,'has thumbnail');
$subtitle=metadata($tourItem,array('Item Type Metadata','Subtitle'));
$description=snippet(metadata($tourItem,array('Item Type Metadata','Story')),0,300,'&hellip; '.$more);
$custom = $tour->getTourItem($tourItem->id);
// description
if(!empty($custom->text)){
$description = $custom->text.' '.$more;
}else{
$description=(element_exists('Item Type Metadata','Story')) ? snippet(metadata($tourItem,array('Item Type Metadata','Story')),0,300,'&hellip; '.$more) : null;
}
// subtitle
if(!empty($custom->subtitle)){
$subtitle = $custom->subtitle;
}else{
$subtitle=(element_exists('Item Type Metadata','Subtitle')) ? metadata($tourItem,array('Item Type Metadata','Subtitle')) : null;
}
$item_image=null;

if ($hasImage){
preg_match('/<img(.*)src(.*)=(.*)"(.*)"/U', item_image('fullsize'), $result);
$item_image = array_pop($result);
}
?>
<div class="item-result <?php echo $hasImage ? 'has-image' : null;?>" >
<h3><a class="permalink" href="
<?php echo url('/') ?>items/show/<?php echo $itemID.'?tour='.tour( 'id' ).'&index='.($i-1).''; ?>">
<h3 class="ti-title"><a class="permalink" href="
<?php echo url('/') ?>items/show/<?php echo $tourItem->id.'?tour='.tour( 'id' ).'&index='.($i-1).''; ?>">
<?php echo '<span class="number">'.$i.'.</span>';?>
<?php echo metadata( $tourItem, array('Dublin Core', 'Title') ); ?>
<?php echo $subtitle ? '<span class="sep">:</span> <span class="subtitle">'.$subtitle.'</span>' : null;?></a></h3>
<?php echo $subtitle ? '<span class="ti-sep">:</span> <span class="ti-subtitle">'.$subtitle.'</span>' : null;?></a></h3>

<?php
echo isset($item_image) ? '<a href="'. url('/') .
'items/show/'.$itemID.'?tour='.tour( 'id' ).'&index='.($i-1).'"><img src="'.$item_image.'" loading="lazy"/></a>' : null;
'items/show/'.$tourItem->id.'?tour='.tour( 'id' ).'&index='.($i-1).'"><img src="'.$item_image.'" loading="lazy" style="max-width:100%;"/></a>' : null;
?>

<div class="item-description">
<div class="ti-text">
<?php echo '<p>'.$description.'</p>'; ?>
</div>
</div>
Expand Down

0 comments on commit 5aabeb9

Please sign in to comment.