From 8acc97b9e409688d16a275dbecad0ec34c71a9a4 Mon Sep 17 00:00:00 2001 From: Raul Gonzalez Date: Fri, 18 Jan 2019 13:49:03 +0100 Subject: [PATCH] Update image.php Handle slice types in image_with_caption other than just the default --- app/views/slices/image.php | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/app/views/slices/image.php b/app/views/slices/image.php index 4852d66..b0519e0 100755 --- a/app/views/slices/image.php +++ b/app/views/slices/image.php @@ -6,9 +6,34 @@ $imageUrl = $imageWithCaption->image->url; $caption = $imageWithCaption->caption; -echo "

"; -echo ""; -if ( $caption ) { - echo "

" . RichText::asText($caption) . "

"; -} -echo "

"; +switch ( $slice->slice_label ) { + + // Full width image + case "image-full-width": + echo "
"; + if ( $caption ) { + echo "

" . RichText::asText($caption) . "

"; + } + echo "
"; + break; + + // Emphasized image + case "emphasized": + echo "

"; + echo ""; + if ( $caption ) { + echo "

" . RichText::asText($caption) . "

"; + } + echo "

"; + break; + + // Default image + default: + echo "

"; + echo ""; + if ( $caption ) { + echo "

" . RichText::asText($caption) . "

"; + } + echo "

"; + break; +} \ No newline at end of file