This commit is contained in:
@@ -2,24 +2,6 @@
|
|||||||
"key": "group_645e7cf448e66",
|
"key": "group_645e7cf448e66",
|
||||||
"title": "Media With Text Block",
|
"title": "Media With Text Block",
|
||||||
"fields": [
|
"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",
|
"key": "field_645e7d22c6701",
|
||||||
"label": "Is Dark",
|
"label": "Is Dark",
|
||||||
@@ -64,7 +46,9 @@
|
|||||||
"allow_null": 0,
|
"allow_null": 0,
|
||||||
"ui": 0,
|
"ui": 0,
|
||||||
"ajax": 0,
|
"ajax": 0,
|
||||||
"placeholder": ""
|
"placeholder": "",
|
||||||
|
"create_options": 0,
|
||||||
|
"save_options": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "field_645e7e2cc6703",
|
"key": "field_645e7e2cc6703",
|
||||||
@@ -270,7 +254,9 @@
|
|||||||
"ui": 0,
|
"ui": 0,
|
||||||
"ajax": 0,
|
"ajax": 0,
|
||||||
"placeholder": "",
|
"placeholder": "",
|
||||||
"parent_repeater": "field_645e7f85c6709"
|
"parent_repeater": "field_645e7f85c6709",
|
||||||
|
"create_options": 0,
|
||||||
|
"save_options": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "field_646501305f6db",
|
"key": "field_646501305f6db",
|
||||||
@@ -297,7 +283,9 @@
|
|||||||
"ui": 0,
|
"ui": 0,
|
||||||
"ajax": 0,
|
"ajax": 0,
|
||||||
"placeholder": "",
|
"placeholder": "",
|
||||||
"parent_repeater": "field_645e7f85c6709"
|
"parent_repeater": "field_645e7f85c6709",
|
||||||
|
"create_options": 0,
|
||||||
|
"save_options": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "field_646501565f6dc",
|
"key": "field_646501565f6dc",
|
||||||
@@ -325,7 +313,9 @@
|
|||||||
"ui": 0,
|
"ui": 0,
|
||||||
"ajax": 0,
|
"ajax": 0,
|
||||||
"placeholder": "",
|
"placeholder": "",
|
||||||
"parent_repeater": "field_645e7f85c6709"
|
"parent_repeater": "field_645e7f85c6709",
|
||||||
|
"create_options": 0,
|
||||||
|
"save_options": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "field_646501735f6dd",
|
"key": "field_646501735f6dd",
|
||||||
@@ -355,7 +345,9 @@
|
|||||||
"ui": 0,
|
"ui": 0,
|
||||||
"ajax": 0,
|
"ajax": 0,
|
||||||
"placeholder": "",
|
"placeholder": "",
|
||||||
"parent_repeater": "field_645e7f85c6709"
|
"parent_repeater": "field_645e7f85c6709",
|
||||||
|
"create_options": 0,
|
||||||
|
"save_options": 0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -385,5 +377,8 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"show_in_rest": 0,
|
"show_in_rest": 0,
|
||||||
"modified": 1742680440
|
"display_title": "",
|
||||||
|
"allow_ai_access": false,
|
||||||
|
"ai_description": "",
|
||||||
|
"modified": 1781367288
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,33 @@
|
|||||||
{
|
{
|
||||||
"name": "acf/media-text",
|
"name": "acf/media-text",
|
||||||
"title": "Media With Text Block",
|
"title": "Media With Text Block",
|
||||||
"description": "2 column content with image and optional calls-to-action",
|
"apiVersion": 3,
|
||||||
"style": [
|
"description": "2 column content with image and optional calls-to-action",
|
||||||
"file:./media-text.css"
|
"style": [
|
||||||
],
|
"file:./media-text.css"
|
||||||
"category": "vdi-blocks",
|
],
|
||||||
"icon": "screenoptions",
|
"category": "vdi-blocks",
|
||||||
"keywords": [
|
"icon": "screenoptions",
|
||||||
"media",
|
"keywords": [
|
||||||
"media-text",
|
"media",
|
||||||
"image",
|
"media-text",
|
||||||
"video",
|
"image",
|
||||||
"text",
|
"video",
|
||||||
"columns"
|
"text",
|
||||||
],
|
"columns"
|
||||||
"acf": {
|
],
|
||||||
"mode": "preview",
|
"acf": {
|
||||||
"renderTemplate": "media-text.php"
|
"blockVersion": 3,
|
||||||
},
|
"mode": "preview",
|
||||||
"supports": {
|
"renderTemplate": "media-text.php"
|
||||||
"align": true,
|
},
|
||||||
"anchor": true,
|
"supports": {
|
||||||
"color": true,
|
"align": true,
|
||||||
"html": true,
|
"anchor": true,
|
||||||
"jsx": true,
|
"color": true,
|
||||||
"mode": true,
|
"html": false,
|
||||||
"multiple": true
|
"jsx": true,
|
||||||
}
|
"mode": true,
|
||||||
|
"multiple": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
namespace CWC;
|
namespace CWC;
|
||||||
|
|
||||||
// Retrieve ACF fields
|
// Retrieve ACF fields
|
||||||
$bgColor = get_field( 'background_color' ) ? get_field( 'background_color' ) : '#c5c5c5';
|
|
||||||
$isDark = get_field( 'is_dark' ) ? get_field( 'is_dark' ) : false;
|
$isDark = get_field( 'is_dark' ) ? get_field( 'is_dark' ) : false;
|
||||||
$mediaLeft = get_field( 'media_on_left' ) ? get_field( 'media_on_left' ) : false;
|
$mediaLeft = get_field( 'media_on_left' ) ? get_field( 'media_on_left' ) : false;
|
||||||
$vidBlock = get_field( 'video' ) ? get_field( 'video' ) : '';
|
$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();
|
$ctas = get_field( 'calls_to_action' ) ? get_field( 'calls_to_action' ) : array();
|
||||||
|
|
||||||
// Set classes and styles
|
// Set classes and styles
|
||||||
$style = "background-color: $bgColor;";
|
|
||||||
$mediaClass = $mediaLeft ? 'order-first' : 'order-last';
|
$mediaClass = $mediaLeft ? 'order-first' : 'order-last';
|
||||||
$contentClass = $mediaLeft ? 'order-last pr-8' : 'order-first pl-8';
|
$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 ) {
|
if ( $isDark ) {
|
||||||
$classes .= ' dark text-white';
|
$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' : ''; ?>">
|
<div class="<?php echo esc_attr( $mediaClass ); ?> <?php echo $vidBlock ? 'aspect-video' : ''; ?>">
|
||||||
<?php if ( $vidBlock ) : ?>
|
<?php if ( $vidBlock ) : ?>
|
||||||
<?php echo wp_kses( $vidBlock, escEmbeds() ); ?>
|
<?php echo wp_kses( $vidBlock, escEmbeds() ); ?>
|
||||||
@@ -65,7 +63,7 @@ if ( $vidBlock && strpos( $vidBlock, '<iframe' ) !== false ) {
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ( ! empty( $ctas ) ) : ?>
|
<?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 foreach ( $ctas as $cta ) : ?>
|
||||||
<?php
|
<?php
|
||||||
$ctaLink = $cta['link'];
|
$ctaLink = $cta['link'];
|
||||||
|
|||||||
Reference in New Issue
Block a user