This commit is contained in:
@@ -2,24 +2,6 @@
|
||||
"key": "group_645e7cf448e66",
|
||||
"title": "Media With Text Block",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_645e7cf4c6700",
|
||||
"label": "Background Color",
|
||||
"name": "background_color",
|
||||
"aria-label": "",
|
||||
"type": "color_picker",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"enable_opacity": 0,
|
||||
"return_format": "string"
|
||||
},
|
||||
{
|
||||
"key": "field_645e7d22c6701",
|
||||
"label": "Is Dark",
|
||||
@@ -64,7 +46,9 @@
|
||||
"allow_null": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_645e7e2cc6703",
|
||||
@@ -270,7 +254,9 @@
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"parent_repeater": "field_645e7f85c6709"
|
||||
"parent_repeater": "field_645e7f85c6709",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_646501305f6db",
|
||||
@@ -297,7 +283,9 @@
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"parent_repeater": "field_645e7f85c6709"
|
||||
"parent_repeater": "field_645e7f85c6709",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_646501565f6dc",
|
||||
@@ -325,7 +313,9 @@
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"parent_repeater": "field_645e7f85c6709"
|
||||
"parent_repeater": "field_645e7f85c6709",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_646501735f6dd",
|
||||
@@ -355,7 +345,9 @@
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"parent_repeater": "field_645e7f85c6709"
|
||||
"parent_repeater": "field_645e7f85c6709",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -385,5 +377,8 @@
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1742680440
|
||||
"display_title": "",
|
||||
"allow_ai_access": false,
|
||||
"ai_description": "",
|
||||
"modified": 1781367288
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user