Advertisement
BufferOverNo

Untitled

Jul 2nd, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.14 KB | None | 0 0
  1. @php
  2.     use Itineris\SageFLBuilder\AbstractHelper;
  3.     use function App\sage;
  4.  
  5.     /** @var AbstractHelper $helper */
  6.     /** @var \App\Plugins\FLBuilder\Modules\CondeNastTeamSection\CondeNastTeamSection $module */
  7.     $helper = sage(AbstractHelper::class);
  8.     if ('1' === $settings->get_from_staff) {
  9.         $settings->items = $helper->getStaffList();
  10.     }
  11. $show_popup = (bool) $settings->show_popup;
  12. @endphp
  13. <section class="team-section">
  14.     @if(!empty($settings->title))
  15.         <header class="title">
  16.             <h2>{{ $settings->title }}</h2>
  17.         </header><!-- title -->
  18.     @endif
  19.     @if(!empty($settings->items))
  20.         <div class="row slider-sm">
  21.             @foreach($settings->items as $item)
  22.                 @php
  23.                     $rand_ids = 'hidden' . random_int('0', '10000');
  24.                     $different_ids = (bool) $settings->different_ids ? $rand_ids : 'fancyhidden';
  25.                 @endphp
  26.                 <div class="col-xl-3 d-flex slide">
  27.                     <figure class="team-box">
  28.                         @if(!empty($item->picture))
  29.                             @php $picture = $helper->getAttachmentImg($item->picture, $size = 'medium-crop') @endphp
  30.                             @if($picture)
  31.                                 <div class="img bg-img">
  32.                                     <img src="{{ $picture['src'] }}" alt="{!! esc_html($item->name) !!}">
  33.                                 </div>
  34.                             @endif
  35.                         @endif
  36.                         <figcaption>
  37.                             @if ($show_popup)
  38.                                 <a {!! ! empty($item->description) ? 'data-fancybox ' . 'data-src="#'.esc_attr($different_ids).'"' : ''!!}
  39.                                    class="holder">
  40.                                     @if(!empty($item->name))
  41.                                         <h3>{!! esc_html($item->name) !!}@if (! empty($item->title) && $item->bold_title)<strong>{!! esc_html($item->title) !!}</strong>@endif</h3>
  42.                                         @if (! $item->bold_title && ! empty($item->title))
  43.                                             {!! esc_html($item->title) !!}
  44.                                         @endif
  45.                                     @endif
  46.                                     @if (! empty($item->description))
  47.                                         <div class="content">
  48.                                             {!! wpautop(wp_kses_post(wp_trim_words($item->description, 20, '...'))) !!}
  49.                                         </div>
  50.                                         <div class="container" style="display:none;"
  51.                                              id="{{ esc_attr($different_ids) }}">
  52.                                             <div class="row">
  53.                                                 @if($picture)
  54.                                                     <div class="col-md-4">
  55.                                                         <div class="text-center">
  56.                                                             <img src="{{ $picture['src'] }}" alt="{!! esc_html($item->name) !!}">
  57.                                                         </div>
  58.                                                     </div>
  59.                                                 @endif
  60.                                                 <div class="col-md-8">
  61.                                                     @if(!empty($item->name))
  62.                                                         <h3>{!! esc_html($item->name) !!}</h3>
  63.                                                             @if (! empty($item->title) && $item->bold_title)<strong>{!! esc_html($item->title) !!}</strong>@endif
  64.                                                         @if (! $item->bold_title && ! empty($item->title))
  65.                                                             {!! esc_html($item->title) !!}
  66.                                                         @endif
  67.                                                     @endif
  68.                                                     {!! wpautop(wp_kses_post($item->description)) !!}
  69.                                                 </div>
  70.                                             </div>
  71.                                         </div>
  72.                                     @endif
  73.                                     @if (! empty($item->description))
  74.                                         <footer class="text-center">
  75.                                             <span class="btn btn-outline-secondary">Read more</span>
  76.                                         </footer>
  77.                                     @endif
  78.                                 </a>
  79.                             @else
  80.                                 @if (! empty($item->link))
  81.                                     <a href="{{ esc_url($item->link) }}" class="holder">
  82.                                         @else
  83.                                             <span class="holder">
  84.                                 @endif
  85.                                                 @if(!empty($item->name))
  86.                                                     <h3>{!! esc_html($item->name) !!}@if (! empty($item->title) && $item->bold_title)<strong>{!! esc_html($item->title) !!}</strong>@endif</h3>
  87.                                                     @if (! $item->bold_title && ! empty($item->title))
  88.                                                         {!! esc_html($item->title) !!}
  89.                                                     @endif
  90.                                                 @endif
  91.                                                 @if (! empty($item->description))
  92.                                                     <div class="content">
  93.                                             {!! wpautop(wp_kses_post(wp_trim_words($item->description, 20, '...'))) !!}
  94.                                         </div>
  95.                                                 @endif
  96.                                                 @if (! empty($item->description) && ! empty($item->link))
  97.                                                     <footer class="text-center">
  98.                                                          <span class="btn btn-outline-secondary">Read more</span>
  99.                                                     </footer>
  100.                                         @endif
  101.                                         @if (! empty($item->link))
  102.                                     </a>
  103.                                     @else
  104.                                     </span>
  105.                                 @endif
  106.                             @endif
  107.                         </figcaption>
  108.                     </figure>
  109.                 </div>
  110.             @endforeach
  111.         </div>
  112.     @endif
  113.     <div class="row">
  114.         <div class="col-md-10 col-lg-11 col-xl-10 mx-auto">
  115.             <div class="text-block">
  116.                 @if(!empty($item->text_block))
  117.                     {!! wpautop(wp_kses_post($item->text_block)) !!}
  118.                 @endif
  119.             </div><!-- text-block -->
  120.         </div><!-- / col -->
  121.     </div>
  122. </section><!-- team-section -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement