{{-- Title: Hero Description: Hero block Category: formatting Icon: columns Keywords: hero Mode: edit Align: left PostTypes: page SupportsAlign: full SupportsMode: true SupportsMultiple: true EnqueueStyle: EnqueueScript: EnqueueAssets: --}} @php global $post; // TRACKING $engPostID = apply_filters( 'wpml_object_id', $post -> ID, 'post', true, 'en-gb' ); $engPost = get_post($engPostID); $blocks = parse_blocks( $engPost -> post_content ); foreach ( $blocks as $block ) { if ( $block['blockName'] === 'acf/hero' ) { $engTitle = $block['attrs']['data']['hero_title']; $engTitle = strip_tags($engTitle); } } // CONTENT $title = get_field('hero_title'); $subtitle = get_field('hero_subtitle'); $image = get_field('hero_image'); $description_title = strip_tags($title); // workaround to remove p & br from wysiwyg editor for this field $formatted_title = strip_tags($title, ''); // workaround to remove p & br from wysiwyg editor for this field $ctaText = get_field('hero_cta_text'); $titleStripped = strip_tags($title); $customClassName = $ctaText ? "no-underline" : ""; $formatted_title = str_replace('
@if( $imageAtTop ) @if ($video) @include('partials.iframe-video-fullwidth', ['$video' => $video, 'marginTop' => true]) @else
{{ $image['alt'] }}
@endif @endif
{!! $formatted_title !!}
{!! $subtitle !!}
@if ($ctaText)
{!! $ctaText !!}
@endif
@if( !$imageAtTop ) @if ($video) @include('partials.iframe-video-fullwidth', ['$video' => $video, 'marginTop' => true]) @else
{{ $image['alt'] }}
@endif @endif
@if( $hasRelatedPosts ) @php $posts = get_field('related_posts'); $count = count($posts); $postAmount = str_pad($count, 2, '0', STR_PAD_LEFT); @endphp
    @foreach($posts as $tile) @php $post = $tile['post']; setup_postdata( $post ); @endphp
  • @include('partials.tile', ['bodyClassModifier' => 'partial-tile__body--reduced-margin partial-tile__body--no-image-up-lg partial-tile__body--image-top-down-md', 'dataLayerLabel' => 'Homepage'])
  • @endforeach @php wp_reset_postdata(); @endphp
previous slide
01 / {{ $postAmount }}
next slide
@endif