🐞 fix: Update media text block styling
Sync TODOs with Issues / sync_todos (push) Successful in 5s

This commit is contained in:
Keith Solomon
2026-06-13 11:33:02 -05:00
parent 94ca7e667e
commit 5d6d9b53eb
3 changed files with 53 additions and 58 deletions
+31 -29
View File
@@ -1,31 +1,33 @@
{
"name": "acf/media-text",
"title": "Media With Text Block",
"description": "2 column content with image and optional calls-to-action",
"style": [
"file:./media-text.css"
],
"category": "vdi-blocks",
"icon": "screenoptions",
"keywords": [
"media",
"media-text",
"image",
"video",
"text",
"columns"
],
"acf": {
"mode": "preview",
"renderTemplate": "media-text.php"
},
"supports": {
"align": true,
"anchor": true,
"color": true,
"html": true,
"jsx": true,
"mode": true,
"multiple": true
}
"name": "acf/media-text",
"title": "Media With Text Block",
"apiVersion": 3,
"description": "2 column content with image and optional calls-to-action",
"style": [
"file:./media-text.css"
],
"category": "vdi-blocks",
"icon": "screenoptions",
"keywords": [
"media",
"media-text",
"image",
"video",
"text",
"columns"
],
"acf": {
"blockVersion": 3,
"mode": "preview",
"renderTemplate": "media-text.php"
},
"supports": {
"align": true,
"anchor": true,
"color": true,
"html": false,
"jsx": true,
"mode": true,
"multiple": true
}
}
+3 -5
View File
@@ -10,7 +10,6 @@
namespace CWC;
// Retrieve ACF fields
$bgColor = get_field( 'background_color' ) ? get_field( 'background_color' ) : '#c5c5c5';
$isDark = get_field( 'is_dark' ) ? get_field( 'is_dark' ) : false;
$mediaLeft = get_field( 'media_on_left' ) ? get_field( 'media_on_left' ) : false;
$vidBlock = get_field( 'video' ) ? get_field( 'video' ) : '';
@@ -24,10 +23,9 @@ $content = get_field( 'content' ) ? get_field( 'content' ) : '';
$ctas = get_field( 'calls_to_action' ) ? get_field( 'calls_to_action' ) : array();
// Set classes and styles
$style = "background-color: $bgColor;";
$mediaClass = $mediaLeft ? 'order-first' : 'order-last';
$contentClass = $mediaLeft ? 'order-last pr-8' : 'order-first pl-8';
$classes = 'media-cols grid grid-cols-1 lg:grid-cols-2 gap-8 items-center mb-8 p-0';
$classes = 'media-cols grid grid-cols-1 lg:grid-cols-2 gap-24 items-center mb-8 p-0 container';
if ( $isDark ) {
$classes .= ' dark text-white';
@@ -42,7 +40,7 @@ if ( $vidBlock && strpos( $vidBlock, '<iframe' ) !== false ) {
}
?>
<div <?php echo wp_kses_post( $wrapper ); ?> style="<?php echo esc_attr( $style ); ?>">
<div <?php echo wp_kses_post( $wrapper ); ?>>
<div class="<?php echo esc_attr( $mediaClass ); ?> <?php echo $vidBlock ? 'aspect-video' : ''; ?>">
<?php if ( $vidBlock ) : ?>
<?php echo wp_kses( $vidBlock, escEmbeds() ); ?>
@@ -65,7 +63,7 @@ if ( $vidBlock && strpos( $vidBlock, '<iframe' ) !== false ) {
<?php endif; ?>
<?php if ( ! empty( $ctas ) ) : ?>
<div class="reset flex flex-wrap justify-center lg:justify-start gap-2">
<div class="reset flex flex-wrap justify-center lg:justify-start gap-2 mt-8">
<?php foreach ( $ctas as $cta ) : ?>
<?php
$ctaLink = $cta['link'];