From 8952ea3f424afa7d852c323bcd932568d9bdfa93 Mon Sep 17 00:00:00 2001 From: Kurtis Holsapple Date: Tue, 17 Jun 2025 10:09:08 -0700 Subject: [PATCH] four col thing --- config.php | 1 + helpers/McCansHelpers.php | 32 +++++++++++++++++++++++++++ tpl/flex_4_column_business_blocks.tpl | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/config.php b/config.php index e990515..3375f55 100644 --- a/config.php +++ b/config.php @@ -80,6 +80,7 @@ return [ "productBox" => \Helpers\McCansHelpers::searchResultBox('product'), "pageBox" => \Helpers\McCansHelpers::searchResultBox('page'), "usd" => \Helpers\McCansHelpers::usd(), + "fourColContent" => \Helpers\McCansHelpers::fourColContent(), ], ], diff --git a/helpers/McCansHelpers.php b/helpers/McCansHelpers.php index 4649498..cb8e33b 100644 --- a/helpers/McCansHelpers.php +++ b/helpers/McCansHelpers.php @@ -25,6 +25,38 @@ class McCansHelpers }; } + public static function fourColContent() + { + return function ($template, $context, $args, $source) { + $content = get_field("flex_four_column_content", "options"); + $icons = [ + "truck", + "chat-dots-fill", + "arrow-counterclockwise", + "credit-card", + ]; + + $output = ""; + foreach ($content as $i => $c) { + $svg = site()->getAssetContents($icons[$i]); + $output .= site()->renderTemplate(<< +
{{{ icon }}}
+
+ {{{ headline }}} + {{{ content }}} +
+ + HTML, [ + "icon" => $svg, + "headline" => $c["headline"], + "content" => $c["sub_headline"], + ]); + } + return $output; + }; + } + public static function locationTile() { return function ($template, $context, $args, $source) { diff --git a/tpl/flex_4_column_business_blocks.tpl b/tpl/flex_4_column_business_blocks.tpl index 9d8cff2..0bc485d 100644 --- a/tpl/flex_4_column_business_blocks.tpl +++ b/tpl/flex_4_column_business_blocks.tpl @@ -1,7 +1,7 @@
- {{#acfOption flex_four_column_content}} + {{#fourColContent}}