Files
CWC/views/blocks/contact-block/contact-block.php
T
Keith Solomon d3e879c439
Sync TODOs with Issues / sync_todos (push) Successful in 6s
feature: Refactor footer layout and styles for improved design consistency
2026-06-06 22:55:32 -05:00

56 lines
1.5 KiB
PHP

<?php
/**
* Block Name: Contact Block
*
* A full-width CTA banner with a background photo, decorative linework overlay,
* body text, and a link button.
*
* @package CWC
*/
namespace CWC;
$bg_image = get_field( 'background_image' );
$text = get_field( 'text' );
$button = get_field( 'button_link' );
$classes = 'contact-block rounded-t-2xl pt-5 container';
$wrapper = blockWrapperAttributes( $classes, $is_preview );
?>
<section <?php echo wp_kses_post( $wrapper ); ?>>
<div class="contact-block__media" aria-hidden="true">
<?php if ( $bg_image ) : ?>
<img
class="contact-block__bg-image"
src="<?php echo esc_url( $bg_image['url'] ); ?>"
alt=""
loading="lazy"
role="presentation"
/>
<?php endif; ?>
<?php get_template_part( '/views/blocks/contact-block/linework' ); ?>
</div>
<div class="contact-block__content container px-4! pt-12 pb-16 relative z-10">
<?php if ( $text ) : ?>
<h2 class="contact-block__text font-quincy font-normal leading-none text-white max-w-4/5 mb-8">
<?php echo wp_kses_post( $text ); ?>
</h2>
<?php endif; ?>
<?php if ( $button ) : ?>
<x-button
btnclasses="contact-block__cta button"
element="a"
url="<?php echo esc_url( $button['url'] ?? '#' ); ?>"
target="<?php echo esc_attr( $button['target'] ?? '_self' ); ?>"
title="<?php echo esc_attr( $button['title'] ?? '' ); ?>"
color="secondary"
variant="outline"
></x-button>
<?php endif; ?>
</div>
</section>