%PDF- %PDF-
Direktori : /var/www/cwg/wp-content/themes/cwg/template-parts/events/ |
Current File : //var/www/cwg/wp-content/themes/cwg/template-parts/events/focus-event.php |
<div class="px-14 leading-6 text-[16px] font-medium hidden md:block uppercase mt-[30px]"> exhibition & fairs </div> <div class="px-5 md:px-14 my-6 md:mt-[15px] md:mb-[20px]"> <?php the_breadcrumbs(); ?> </div> <div class="flex flex-col md:flex-row px-5 md:px-14 md:mb-[60px]"> <div class="w-full md:w-3/5 mb-6 md:mb-0 md:max-h-[460px]"> <div class="js-exhib-carrousel exhib-carrousel w-full hidden md:block"> <?php ob_start(); ?> <?php $vimeoAlreadyIn = [] ?> <?php $youtubeAlreadyIn = [] ?> <?php if($images_gallery): ?> <?php foreach ($images_gallery as $image) : ?> <div class="h-fit-content md:h-[460px]"> <?= wp_get_attachment_image($image['id'], 'full', false, array('class' => 'h-auto w-full md:h-full md:w-auto object-cover')); ?> </div> <?php endforeach; ?> <?php endif; ?> <?php $videos = get_field('videos'); ?> <?php if($videos): ?> <?php foreach ($videos as $video) : ?> <?php if(!in_array($video['vimeo'], $vimeoAlreadyIn)): ?> <?php array_push($vimeoAlreadyIn, $video['vimeo']) ?> <iframe title="video" class="vimeo-video js-video" src="https://player.vimeo.com/video/<?= $video['vimeo'] ?>"></iframe> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> <?php $slider = get_field('slider'); ?> <?php if($slider): ?> <?php foreach($slider as $slide): ?> <?php switch($slide['type']): case 'video': ?> <?php if(!in_array($slide['video'], $vimeoAlreadyIn)): ?> <?php array_push($vimeoAlreadyIn, $slide['vimeo']) ?> <iframe title="video" class="vimeo-video js-video" src="https://player.vimeo.com/video/<?= $slide['video'] ?>"></iframe> <?php endif; ?> <?php break; case 'youtube': ?> <?php if(!in_array($slide['youtube'], $youtubeAlreadyIn)): ?> <?php array_push($youtubeAlreadyIn, $slide['youtube']) ?> <iframe title="video" class="vimeo-video js-video" src="https://youtube.com/embed/<?= $slide['youtube'] ?>"></iframe> <?php endif; ?> <?php break; case 'gallery': $images = $slide['gallery']; if($images): ?> <?php foreach ($images as $image) : ?> <div class="h-fit-content md:h-[460px]"> <?= wp_get_attachment_image($image['id'], 'full', false, array('class' => 'h-auto w-full md:h-full md:w-auto object-cover')); ?> </div> <?php endforeach; ?> <?php endif; break; endswitch; ?> <?php endforeach; ?> <?php endif; ?> <?php $carrousel_content = ob_get_clean(); ?> <?= $carrousel_content ?> </div> <div class="js-exhib-carrousel-mobile md:hidden exhib-carrousel w-full"> <?= $carrousel_content ?> </div> </div> <div class="flex flex-col w-full md:pl-10 md:max-h-[460px] md:overflow-y-auto md:pr-8 md:relative scrollbar-thin"> <div class="flex flex-row"> <h1 class="uppercase leading-6 font-medium"><?= $title ?></h1> <div class="ml-auto hidden md:block"> <div class="flex-row flex cursor-pointer" onclick="copyToClipboard()"> <span class="mr-1"><?php include(locate_template('/assets/img/share-black.svg')); ?> </span> <div class="flex text-xs uppercase font-thin items-center">Share</div> </div> </div> </div> <div class="flex mb-4"> <h2 class="leading-4 font-light text-grey-textLight uppercase"><?= $subtitle ?></h2> </div> <div class="text-xs font-light gap-3 grid grid-cols-1"> <div class="flex flex-row"> <div class="gap-3 flex flex-col"> <?php if(!get_field('location_override')): ?> <p> <?= get_field('date_override') ? get_field('date_override') : $date ?> <?php if(get_field('days_open') || get_field('hours_open')): ?> <br/> <?= get_field('days_open') ?> <?= get_field('days_open') && get_field('hours_open') ? ' | ' : '' ?> <?= get_field('hours_open') ?> <?php endif; ?> </p> <?php endif; ?> <?= $textAdress ?> </div> <div class="ml-auto md:hidden"> <div class="flex-row flex cursor-pointer" id="js-share-button"> <span class="mr-1"><?php include(locate_template('/assets/img/share-black.svg')); ?> </span> <div class="flex text-xs uppercase font-thin items-center">Share</div> </div> </div> </div> <?php if (isset($fair) && $fair) : ?> <a href="<?= get_permalink($fair->ID) ?>"><?= $fair->post_title ?></a> <?php endif; ?> <?php $fair_website = get_field('fair_website'); ?> <?php if($fair_website): ?> <a target="<?= $fair_website['target'] ?>" href="<?= $fair_website['url'] ?>"> <?= $fair_website['title'] ?> </a> <?php endif; ?> <div id="more" class="hidden gap-3 md:grid grid grid-cols-1 content-description overflow-hidden"> <?= the_content(); ?> </div> </div> <?php if ($mapsLink || $catalogue) : ?> <div class="hidden md:flex flex-row gap-x-2 mt-[26px]"> <?php if ($mapsLink) : ?> <div data-url="<?= $mapsLink ?>" class="btn-stroked-variant w-full py-4 js-maps-url">Directions</div> <?php endif; ?> <?php if ($catalogue) : ?> <a target="_blank" rel="noopener noreferrer nofollow" href="<?= $catalogue ?>" class="btn-stroked-variant w-full py-4"> <div class="h-[15px] w-[15px] mr-1"> <?php include(locate_template('/assets/img/icon-black-file-download-24-px.svg')); ?> </div> Download Catalogue </a> <?php endif; ?> </div> <?php endif; ?> </div> </div> <div class="w-full flex flex-col px-5 md:hidden mb-[30px] mt-[10px] gap-5"> <?php if(!empty(get_the_content())): ?> <?php $text_more = get_post_type() == 'exhibitions' ? '> Exhibition statement' : '> Learn more' ?> <div> <a class="text-xs font-thin underline-carpenters pr-1 cursor-pointer md:hidden" data-more="<?= $text_more ?>" data-less="> Less" onclick="showMore()" id="link-show"><?= $text_more ?></a> </div> <?php endif; ?> <?php if ($mapsLink || $catalogue) : ?> <div class="flex md:hidden flex-row gap-x-2"> <?php if ($mapsLink) : ?> <div data-url="<?= $mapsLink ?>" class="btn-stroked w-full py-4 js-maps-url">Directions</div> <?php endif; ?> <?php if ($catalogue) : ?> <a target="_blank" rel="noopener noreferrer nofollow" href="<?= $catalogue ?>" class="btn-stroked w-full py-4"> <div class="h-[15px] w-[15px] mr-1"> <?php include(locate_template('/assets/img/icon-black-file-download-24-px.svg')); ?> </div> Download Catalogue </a> <?php endif; ?> </div> <?php endif; ?> </div> <?php if (!empty($selectionsOfWorks)) : ?> <?php ob_start(); foreach ($selectionsOfWorks as $prod) { $product_post = new WP_Query(['p' => $prod, 'post_type' => 'product', 'post_status' => 'publish']); if ($product_post->have_posts()) { $product_post->the_post(); $product = wc_get_product($prod); $price = $product->get_price(); $artist = get_field('multiple_artist_title') ? get_field('multiple_artist_title') : get_field('artist_override'); include(locate_template('template-parts/products/collectible-item.php')); } } wp_reset_postdata(); $allWorks = ob_get_clean(); ?> <?php if(!empty($allWorks)): ?> <section class="w-full mb-[30px] md:mb-[60px] px-5 md:px-14"> <div class="w-full flex items-center justify-between mb-[15px] md:mb-[30px]"> <h2 class="text-[13px] md:text-[15px] font-normal uppercase">Selection of Works</h2> </div> <div class="w-full grid grid-cols-2 gap-[13px] grid-rows-2 md:gap-[30px] md:grid-cols-4 artist-collectibles"> <?= $allWorks ?> </div> </section> <?php endif; ?> <?php endif; ?> <?php if (!empty($selectionsOfJewellery)) : ?> <?php ob_start(); foreach ($selectionsOfJewellery as $prod) { $product_post = new WP_Query(['p' => $prod, 'post_type' => 'product', 'post_status' => 'publish']); if ($product_post->have_posts()) { $product_post->the_post(); $product = wc_get_product($prod); $price = $product->get_price(); $artist = get_field('multiple_artist_title') ? get_field('multiple_artist_title') : get_field('artist_override'); include(locate_template('template-parts/products/list-item-reco-little.php')); } } wp_reset_postdata(); $allJewellery = ob_get_clean(); ?> <?php if(!empty($allJewellery)): ?> <section class="w-full mb-[30px] md:mb-[60px] px-5 md:px-14"> <div class="w-full flex items-center justify-between mb-[15px] md:mb-[30px]"> <h2 class="text-[13px] md:text-[15px] font-normal uppercase">Selection of Jewellery</h2> </div> <div class="w-full grid grid-cols-2 gap-3 grid-rows-1 md:gap-10 md:grid-cols-4"> <?= $allJewellery ?> </div> </section> <?php endif; ?> <?php endif; ?> <?php if ($artists && count($artists) > 1) : ?> <section class="w-full mb-[30px] md:mb-[60px] px-5 md:px-14"> <div class="uppercase leading-6 text-[13px] md:text-[15px]">The artists</div> <div class='grid grid-cols-2 md:grid-cols-4 gap-3 md:gap-10 mt-[15px] md:mt-[30px] js-artist-container'> <?php foreach ($artists as $artist) : ?> <?php $image = get_field('tall_large_grid_image', $artist->ID); ?> <a href="<?= get_permalink($artist->ID) ?>" class="w-full h-72 md:h-[485px] relative"> <?= wp_get_attachment_image($image_background['id'], 'full', false, array('class' => 'object-cover w-full h-full')); ?> <div class="bg-gradient-linear absolute w-full h-full top-0 left-0"></div> <h2 class="uppercase text-white text-[11px] leading-4 md:leading-7 absolute bottom-[10px] left-[10px] md:left-[20px] font-medium"><?= $artist->post_title ?></h2> </a> <?php endforeach; ?> </div> </section> <?php elseif (is_array($artists) && $artists[0]) : ?> <?php $artist = $artists[0]; ?> <?php $image = get_field('tall_large_grid_image', $artist->ID); ?> <section class="w-full mb-[30px] md:mb-[60px] px-5 md:px-14"> <h2 class="text-[13px] leading-6 uppercase md:hidden mb-2"><?= $artist->post_title ?></h2> <div class="flex flex-col md:grid md:grid-cols-2 gap-x-[34px]"> <div> <?= wp_get_attachment_image($image['id'], 'full', false, array('class' => 'object-cover w-full h-[374px] md:h-[716px] mb-[15px]')); ?> </div> <div class="text-xs md:pr-11"> <h2 class="text-[15px] leading-6 uppercase hidden md:block mb-[10px]"><?= $artist->post_title ?></h2> <div class="artist-description flex flex-col gap-3"> <?= get_field('description', $artist->ID); ?> </div> <a href="<?= get_permalink($artist->ID) ?>" class="btn-stroked py-4 uppercase w-full mt-[19px] md:w-[170px]">more information</a> </div> </div> </section> <?php endif; ?> <?php $numberMoreEvent = 0; $allMoreEventIds = []; if(!empty($moreEvents)) { foreach ($moreEvents as $event) { if(isset($event->ID)) { array_push($allMoreEventIds, $event->ID); $numberMoreEvent++; } } } $args = array( 'posts_per_page' => 4 - $numberMoreEvent, 'post_type' => ['exhibitions', 'fairs', 'popups'], 'post__not_in' => array_merge([get_the_ID()], $allMoreEventIds), 'post_status' => 'publish', 'meta_key' => 'start_date', 'orderby' => 'meta_value', 'order' => 'DESC' ); $moreEventQuery = new WP_Query($args); ?> <div class="w-full mb-[30px] md:mb-[60px] px-5 md:px-14"> <div class="text-[13px] md:text-[15px] leading-6 uppercase mb-[10px] md:mb-[30px]">more events</div> <div class="w-full flex flex-row pb-2 overflow-x-auto gap-2.5 lg:gap-7"> <?php $desktop_class = 'h-[340px] w-[340px] min-w-[340px]'; ?> <?php if (!empty($moreEvents)) : ?> <?php foreach ($moreEvents as $event) : ?> <?php include(locate_template('template-parts/events/event-item.php')); ?> <?php endforeach; ?> <?php endif; ?> <?php if($moreEventQuery->have_posts()): ?> <?php foreach($moreEventQuery->posts as $event): ?> <?php include(locate_template('template-parts/events/event-item.php')); ?> <?php endforeach; ?> <?php endif; ?> </div> </div>