Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- elseif ( get_row_layout() == 'tooltips' || get_row_layout() == 'tooltips_en' ):
- ?>
- <!-- Start alternating columns -->
- <?php
- $bgswitch = get_sub_field_object( 'bg_switch' );
- if ( $bgswitch['value'] == 'custom' ) {
- get_template_part( 'template-parts/page/custom-tooltip-image' );
- }
- if ( $bgswitch['value'] == 'vy' || $bgswitch['value'] == 'vu' ) {
- ?>
- <div class="tt-v-block video-block">
- <?php
- }
- ?>
- <div class="container" id="b<?php echo $block_counter; ?>">
- <div class="row">
- <div class="tooltip-image-container">
- <?php
- $tooltipBoxCounter = 0;
- while ( have_rows( 'tooltips_container' ) ): the_row();
- $tooltipBoxCounter ++;
- ?>
- <?php $rng_for_click = uniqid(); ?>
- <a title="" class="tooltip-anker small"
- data-anker="<?php echo $rng_for_click; ?>-<?php echo $tooltipBoxCounter; ?>"
- style="left: <?php the_sub_field( 'tooltip_x_position' ); ?>%; top: <?php the_sub_field( 'tooltip_y_position' ); ?>%;">
- <img class="tooltip-graphic"
- src="<?php bloginfo( 'template_directory' ); ?>/assets/images/signal-icon-<?php the_sub_field( 'color_tooltip_image' ); ?>.svg"
- alt=""/>
- </a>
- <?php
- $tooltip_x_pos;
- if ( get_sub_field( 'tooltip_x_position' ) > 75 || get_sub_field( 'tooltip_x_position' ) < 25 ) {
- if ( get_sub_field( 'tooltip_x_position' ) > 75 ) {
- $tooltip_x_pos = 75;
- } else {
- //if(get_sub_field('tooltip_x_position') < 25)
- $tooltip_x_pos = 25;
- }
- } else {
- $tooltip_x_pos = get_sub_field( 'tooltip_x_position' );
- }
- ?>
- <div class="tooltip-box <?php echo $rng_for_click ?>-<?php echo $tooltipBoxCounter; ?>"
- data-anker="<?php echo $rng_for_click; ?>-<?php echo $tooltipBoxCounter; ?>"
- style="left: <?php echo $tooltip_x_pos; ?>%; top: <?php the_sub_field( 'tooltip_y_position' ); ?>%;">
- <a class="close-button">
- <img src="<?php bloginfo( 'template_directory' ); ?>/assets/images/close-button.svg"
- alt=""/>
- </a>
- <?php
- the_sub_field( 'tooltip_content' );
- $ttiplink = get_sub_field( 'tooltip_link' );
- ?>
- <?php if ( $ttiplink ): ?>
- <?php
- if ( $ttiplink['title'] ) {
- $labeltext = $ttiplink['title'];
- } else {
- $labeltext = 'Mehr erfahren';
- }
- ?>
- <a href="<?php echo $ttiplink['url']; ?>"
- title="<?php echo $labeltext; ?>"><?php echo $labeltext; ?></a>
- <?php endif; ?>
- </div>
- <?php endwhile; ?>
- <?php
- $bgswitch = get_sub_field_object( 'bg_switch' );
- if ( $bgswitch['value'] == 'vy' ) {
- //youtube video
- $tooltipVideo = get_sub_field( "tooltip_video" );
- //get iframe HTML
- preg_match( '/src="(.+?)"/', $tooltipVideo, $matches );
- $src = $matches[1];
- //setting variables for array
- $ctrl = 0;
- $mute = 0;
- $autoplay = 1;
- if ( get_sub_field( 'video_control' ) ) {
- $ctrl = 1;
- $autoplay = 0;
- }
- if ( get_sub_field( 'video_mute' ) ) {
- $mute = 1;
- }
- // add extra params to iframe src
- $params = array(
- 'controls' => $ctrl,
- 'hd' => 1,
- 'autohide' => 1,
- 'autoplay' => $autoplay,
- 'showinfo' => 0,
- 'modestbranding' => 1,
- 'allowfullscreen' => 1,
- 'disablekb' => 1,
- 'fs' => 0,
- 'loop' => 1,
- 'iv_load_policy' => 3,
- 'playlist' => $src,
- 'mute' => $mute
- );
- $new_src = add_query_arg( $params, $src );
- $tooltipVideo = str_replace( $src, $new_src, $tooltipVideo );
- // add extra attributes to iframe html
- $attributes = 'frameborder="0"';
- $tooltipVideo = str_replace( '></iframe>', ' ' . $attributes . '></iframe>', $tooltipVideo );
- ?>
- <div class="heading">
- <h2><?php echo get_sub_field( 'headline_video' ); ?></h2>
- <div class="text">
- <?php echo get_sub_field( 'video_description' ); ?>
- </div>
- </div>
- <div class="video-wrap">
- <?php
- if ( $ctrl == 0 ) {
- ?>
- <div class="fence"></div>
- <?php
- }
- ?>
- <?php
- // echo $tooltipVideo
- echo $tooltipVideo;
- ?>
- </div>
- <?php
- } else {
- if ( $bgswitch['value'] == 'vu' ) {
- //setting variables for array
- $ctrl = 0;
- $mute = 0;
- $autoplay = 1;
- if ( get_sub_field( 'video_control' ) ) {
- $ctrl = 1;
- $autoplay = 0;
- }
- if ( get_sub_field( 'video_mute' ) ) {
- $mute = 1;
- }
- //upload video
- ?>
- <div class="heading video-heading">
- <h2 class="text-white"><?php echo get_sub_field( 'headline_video' ); ?></h2>
- <div class="text text-white">
- <?php echo get_sub_field( 'video_description' ); ?>
- </div>
- </div>
- <div class="video-wrap uploaded">
- <video <?php if ( $ctrl == 1 ): ?> controls="controls" <?php endif; ?> <?php if ( $autoplay == 1 ): ?> autoplay="autoplay" <?php endif; ?>
- preload="auto" <?php if ( $mute == 1 ): ?> muted="muted" <?php endif; ?>
- src="<?php the_sub_field( 'uploaded_video' ); ?>">
- </div>
- <?php
- } else {
- //image
- $tooltipImage = get_sub_field( 'tooltip_image' );
- $tooltipImageID = $tooltipImage['ID'];
- echo wp_get_attachment_image( $tooltipImageID, 'tooltip_image', false );
- }
- }
- ?>
- </div>
- </div>
- </div>
- <?php
- if ( $bgswitch['value'] == 'vy' || $bgswitch['value'] == 'vu' ) {
- ?>
- </div>
- <?php
- }
- ?>
- <!-- End content -->
- <?php
- elseif ( get_row_layout() == 'two_columns' ):
- ?>
- <!-- Start alternating columns -->
- <div class="container two-columns <?php echo ( get_sub_field( 'is_first_element' ) ) ? 'is-first-element' : ''; ?>"
- id="b<?php echo $block_counter; ?>">
- <div class="row">
- <div class="offset-md-1 col-md-4 column-1">
- <?php the_sub_field( 'column_1' ); ?>
- </div>
- <div class="col-md-7 column-2">
- <?php the_sub_field( 'column_2' ); ?>
- </div>
- </div>
- </div>
- <!-- End content -->
- <?php
- elseif ( get_row_layout() == 'info_slider' ):
- $arr_color = get_sub_field_object( 'is_arrow-color' );
- $slider_color_class;
- if ( $arr_color['value'] == 'w' ) {
- $slider_color_class = "white";
- } else {
- $slider_color_class = "red";
- }
- ?>
- <!-- Start alternating columns -->
- <div class="slider-outer-wrap <?php echo $slider_color_class; ?>">
- <div class="container custom-slider-container" id="b<?php echo $block_counter; ?>">
- <?php
- $countSignInItems = 0;
- $slides = get_sub_field( 'is_slide-selector' );
- ?>
- <div class="col-12 custom-slider">
- <?php
- if ( $slides ):
- foreach ( $slides as $slide ):
- $curProjID = $slide;
- if ( get_field( 'headline', $curProjID ) || get_field( 'box', $curProjID ) || get_field( 'box_link', $curProjID ) || get_field( 'text', $curProjID ) || get_field( 'download_details_link', $curProjID ) || get_field( 'image', $curProjID ) || get_field( 'review', $curProjID ) || get_field( 'review_person', $curProjID ) || get_field( 'review_person_image', $curProjID ) ):
- $countSignInItems ++;
- if ( count( $slides ) > 1 ) {
- $item_style;
- if ( $countSignInItems == 1 ) {
- $item_style = "display: block;";
- } else {
- $item_style = "display: none;";
- }
- }
- ?>
- <div class="slide-item content i<?php echo $countSignInItems; ?>"
- style="<?php echo $item_style; ?>">
- <div class="row first-content">
- <div class="col-lg-8 col-12 order-last order-lg-first">
- <div class="heading">
- <h2>
- <?php the_field( 'headline', $curProjID ); ?>
- </h2>
- </div>
- <div class="text">
- <?php the_field( 'text', $curProjID ); ?>
- </div>
- <div class="red-box">
- <div class="subtext">
- <?php the_field( 'box', $curProjID ); ?>
- <?php if ( get_field( 'box_link', $curProjID ) ): ?>
- <a href="<?php the_field( 'box_link', $curProjID ); ?>"
- title="<?php esc_html_e( 'Mehr erfahren', 'more' ); ?>"><?php esc_html_e( 'Mehr erfahren', 'more' ); ?></a>
- <?php endif; ?>
- </div>
- </div>
- </div>
- <div class="col-lg-4 col-12 order-first order-lg-last">
- <div class="img-wrap">
- <?php
- $image = get_field( 'image', $curProjID );
- $imageID = $image['ID'];
- echo wp_get_attachment_image( $imageID, 'slider_image', false );
- ?>
- </div>
- </div>
- </div>
- <?php if ( get_field( 'review_person_image', $curProjID ) || get_field( 'review', $curProjID ) || get_field( 'review_person', $curProjID ) ): ?>
- <div class="row second-content">
- <div class="col-lg-2 offset-lg-1 offset-3 col-6">
- <div class="img-wrap">
- <?php
- $imagePerson = get_field( 'review_person_image', $curProjID );
- $imagePersonID = $imagePerson['ID'];
- echo wp_get_attachment_image( $imagePersonID, 'large', false );
- ?>
- </div>
- </div>
- <div class="offset-lg-0 col-lg-9 col-10 offset-1">
- <div class="quote-wrap">
- <div class="quote">
- <?php the_field( 'review', $curProjID ); ?>
- </div>
- <div class="quotee">
- <?php the_field( 'review_person', $curProjID ); ?>
- </div>
- </div>
- </div>
- </div>
- <?php endif; ?>
- </div>
- <?php
- endif;
- endforeach;
- endif;
- if ( $countSignInItems > 1 ) {
- if ( $arr_color['value'] == 'w' ) {
- ?>
- <a href="#" title="" onclick="return false;" class="slide-next">
- <img class="tooltip-graphic"
- src="<?php bloginfo( 'template_directory' ); ?>/assets/images/next-button-sg.svg"
- alt=""/>
- </a>
- <a href="#" title="" onclick="return false;" class="slide-previous">
- <img class="tooltip-graphic"
- src="<?php bloginfo( 'template_directory' ); ?>/assets/images/previous-button-sg.svg"
- alt=""/>
- </a>
- <?php
- } else {
- ?>
- <a href="#" title="" onclick="return false;" class="slide-next">
- <img class="tooltip-graphic"
- src="<?php bloginfo( 'template_directory' ); ?>/assets/images/next-button-b.svg"
- alt=""/>
- </a>
- <a href="#" title="" onclick="return false;" class="slide-previous">
- <img class="tooltip-graphic"
- src="<?php bloginfo( 'template_directory' ); ?>/assets/images/previous-button-b.svg"
- alt=""/>
- </a>
- <?php
- }
- }
- ?>
- <div class="slide-indicators">
- <ul>
- <?php $countSignInItems = 0;
- while ( have_rows( 'images_right' ) ) : the_row();
- $countSignInItems ++; ?>
- <li class="i<?php echo $countSignInItems; ?>">
- </li>
- <?php endwhile; ?>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <!-- End content -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement