four col thing

This commit is contained in:
2025-06-17 10:09:08 -07:00
parent 9e06826533
commit 8952ea3f42
3 changed files with 34 additions and 1 deletions

View File

@@ -80,6 +80,7 @@ return [
"productBox" => \Helpers\McCansHelpers::searchResultBox('product'),
"pageBox" => \Helpers\McCansHelpers::searchResultBox('page'),
"usd" => \Helpers\McCansHelpers::usd(),
"fourColContent" => \Helpers\McCansHelpers::fourColContent(),
],
],

View File

@@ -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(<<<HTML
<div class="col">
<div class="icon-wrapper">{{{ icon }}}</div>
<div class="content-wrapper">
<strong>{{{ headline }}}</strong>
{{{ content }}}
</div>
</div>
HTML, [
"icon" => $svg,
"headline" => $c["headline"],
"content" => $c["sub_headline"],
]);
}
return $output;
};
}
public static function locationTile()
{
return function ($template, $context, $args, $source) {

View File

@@ -1,7 +1,7 @@
<section class="four-column-blocks">
<div class="container">
<div class="row">
{{#acfOption flex_four_column_content}}
{{#fourColContent}}
</div>
</div>
</section>