From dfe7d978db32a117aa9376fc5e27a7bce14c5509 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 12 Dec 2015 19:35:38 +0100 Subject: [PATCH] handle empty title --- controller/classes/Subtemplate.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/controller/classes/Subtemplate.php b/controller/classes/Subtemplate.php index 794ce3e..4b73eb1 100644 --- a/controller/classes/Subtemplate.php +++ b/controller/classes/Subtemplate.php @@ -296,7 +296,10 @@ class Subtemplate { return $result; } public function callToAction($subtemplateTitle) { - $ctaTitle = $subtemplateTitle; + + if ($subtemplateTitle) { + $ctaTitle = "

$subtemplateTitle

"; + } $ctaText = get_sub_field('cta_button_text'); $ctaLink = get_sub_field('cta_button_link'); $backgroundImg = get_sub_field('image')['url']; @@ -304,7 +307,7 @@ class Subtemplate { $result = "
-

{$ctaTitle}

+ {$ctaTitle} {$ctaText}
";