From 5aabeb92b023ad03afa5cb2a53d1ef8957574e12 Mon Sep 17 00:00:00 2001 From: Erin Bell Date: Tue, 2 Apr 2024 11:57:01 -0400 Subject: [PATCH] minor/misc form revisions --- views/public/tours/show.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/views/public/tours/show.php b/views/public/tours/show.php index 62e0b62..8a5b586 100644 --- a/views/public/tours/show.php +++ b/views/public/tours/show.php @@ -34,37 +34,41 @@ foreach( $tour->getItems() as $tourItem ): if($tourItem->public || current_user()){ set_current_record( 'item', $tourItem ); - $itemID=$tourItem->id; - $more=''.__('Learn more').''; + $item_image=null; + $more=''.__('Learn more').''; $hasImage=metadata($tourItem,'has thumbnail'); - $subtitle=metadata($tourItem,array('Item Type Metadata','Subtitle')); - $description=snippet(metadata($tourItem,array('Item Type Metadata','Story')),0,300,'… '.$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,'… '.$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('/
-

+ : '.$subtitle.'' : null;?>

' : null; + 'items/show/'.$tourItem->id.'?tour='.tour( 'id' ).'&index='.($i-1).'">' : null; ?> -
+
'.$description.'

'; ?>