39 lines
1.5 KiB
PHP
39 lines
1.5 KiB
PHP
<?php
|
|
|
|
$pageHeaderTitle = $attributes['pageHeaderTitle'] ?? null;
|
|
$pageHeaderDescription = $attributes['pageHeaderDescription'] ?? null;
|
|
$cta = $attributes['cta'] ?? null;
|
|
$pageIcon = get_field('page_icon');
|
|
|
|
$hasCustomImage = $attributes['hasCustomImage'] ?? null;
|
|
$customImageUrl = $attributes['imageUrl'] ?? null;
|
|
$customImageAlt = $attributes['imageAlt'] ?? null;
|
|
|
|
$customTitle = $attributes['blockCustomTitle'] ?? null;
|
|
|
|
?>
|
|
|
|
|
|
<section <?php echo get_block_wrapper_attributes(['class' => 'block-content-page-header']) ?>>
|
|
<div class="block-content-page-header__content">
|
|
<?php if (!$attributes['hasCustomTitle']) : ?>
|
|
<h1><?php echo get_the_title() ?></h1>
|
|
<?php endif; ?>
|
|
<?php if ($attributes['hasCustomTitle'] && $customTitle) : ?>
|
|
<h1><?php echo $customTitle ?></h1>
|
|
<?php endif; ?>
|
|
<h2><?php echo $pageHeaderTitle ?> </h2>
|
|
<p><?php echo $pageHeaderDescription ?> </p>
|
|
<?php if ($cta && $cta['title'] && $cta['url']) : ?>
|
|
<a class="block-content-page-header__cta-link" href="<?php echo $cta['url'] ?>"><?php echo $cta['title'] ?></a>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<?php if ($pageIcon && !$hasCustomImage) : ?>
|
|
<img class="block-content-page-header__page-icon" src="<?php echo $pageIcon['url'] ?>" alt="">
|
|
<?php endif; ?>
|
|
<?php if ($hasCustomImage && $customImageUrl) : ?>
|
|
<img class="block-content-page-header__page-icon" src="<?php echo $customImageUrl ?>" alt="<?php echo $customImageAlt ?>">
|
|
<?php endif; ?>
|
|
|
|
</section>
|