<!-- 最大10件 -->
<?php if(!empty($cms__items)): ?>
<div class="results_inner">
<?php foreach($cms__items as $item_index => $cms__item) : ?>
<?php
$main_images = $cms__item->getMainImage();
$thumbnail_images = $main_images->getChildren();
$this_month_recommendation = $cms__item->isThisMonthRecommendation();
$link = $cms__item->getDetailLink(LOCATION);
?>
<!-- おすすめ店舗の場合はrecommendクラスを付与 -->
<section class="item<?php if($this_month_recommendation == true) echo ' recommend'; ?>">
<a href="<?php echo $link['url']; ?>">
<?php if($this_month_recommendation == true) : ?>
<!-- おすすめの場合は表示 -->
<div class="ribbon">今月の<br>おすすめ</div>
<?php endif; ?>
<div class="box_data">
<div class="data_inner">
<div class="shop_name">
<h3 class="st"><?php echo $cms__item->getTitle(); ?></h3>
<?php
$genres = $cms__item->getGenres();
?>
<?php if(!empty($genres->toArray())) : ?>
<!-- ジャンル、表示要否チェック -->
<?php
$genre_show_flag_all = false;
foreach($genres as $genre) {
$genre_show_flag = $genre->isShowInList();
if($genre_show_flag == true) {
$genre_show_flag_all = true;
break;
}
}
?>
<?php if($genre_show_flag_all == true) : ?>
<div class="tmp_genre">
<?php foreach($genres as $genre) : ?>
<?php
$genre_show_text = $genre->getTitleForList();
if($genre_show_text == '')
{
$genre_show_text = $genre->getTitle();
}
$genre_show_flag = $genre->isShowInList();
?>
<?php if($genre_show_flag == true) : ?>
<span><?php echo $genre_show_text; ?></span>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if($cms__item->getTimeByCars() != null) : ?>
<div class="tmp_car">
<span>ジブリパーク<br class="view_pc-tab">から車で<?php echo $cms__item->getTimeByCars(); ?>分圏内</span>
</div>
<?php endif; ?>
<?php if((string)($cms__item->getDescription() != '')) : ?>
<p class="txt">
<?php echo nl2br($cms__item->getDescription()); ?>
</p>
<?php endif; ?>
<?php
$features = $cms__item->getFeatures();
?>
<?php if(!empty($features->toArray())) : ?>
<!-- 特徴、表示要否チェック -->
<?php
$feature_show_flag_all = false;
foreach($features as $feature) {
$feature_show_flag = $feature->isShowInList();
if($feature_show_flag == true) {
$feature_show_flag_all = true;
break;
}
}
?>
<?php if($feature_show_flag_all == true) : ?>
<div class="rabel">
<?php foreach($features as $feature) : ?>
<?php
$feature_show_text = $feature->getTitleForList();
if($feature_show_text == '')
{
$feature_show_text = $feature->getTitle();
}
$feature_show_flag = $feature->isShowInList();
$feature_bg_class = " class='take'";
$feature_bg_flag = $feature->isBackgroundColor();
if($feature_bg_flag == true)
{
$feature_bg_class = " class='coupon'";
}
?>
<?php if($feature_show_flag == true) : ?>
<span<?php echo $feature_bg_class; ?>><?php echo $feature_show_text; ?></span>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if((string)($cms__item->getBusinessHours()) != '' || (string)($cms__item->getHoliday()) != '') : ?>
<div class="data">
<?php if((string)($cms__item->getBusinessHours()) != '') : ?>
<span class="time"><?php echo $cms__item->getBusinessHours(); ?></span>
<?php endif; ?>
<?php if((string)($cms__item->getHoliday()) != '') : ?>
<span class="off"><?php echo $cms__item->getHoliday(); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="box_img">
<?php if(count($thumbnail_images) == 0) : ?>
<!-- もし画像ない場合はslider_innerにnoimgを付与 -->
<div class="slider_inner noimg">
<div class="img img_r">
</div>
</div>
<?php elseif(count($thumbnail_images) < 2) : ?>
<?php foreach($thumbnail_images as $image) : ?>
<?php
$imageUrl = ($image && $image->hasItem()) ? $view['image']->getMediaUrl($image, 390, 293, 'contain') : null;
?>
<!-- 画像1枚のみの場合 -->
<div class="slider_inner">
<div class="img img_r">
<?php lazyImage('', ["390/293"], $imageUrl, $image->getAlt()); ?>
</div>
</div>
<?php endforeach; ?>
<?php else : ?>
<!-- 画像複数枚の場合 -->
<div class="slider_inner js-main-img">
<?php foreach($thumbnail_images as $image_index => $image) : ?>
<?php
$imageUrl = ($image && $image->hasItem()) ? $view['image']->getMediaUrl($image, 390, 293, 'contain') : null;
?>
<div class="slide block img img_r" data-id="show<?php echo $item_index + 1; ?>-<?php echo $image_index + 1; ?>">
<?php lazyImage('', ["390/293"], $imageUrl, $image->getAlt()); ?>
</div>
<?php endforeach; ?>
</div>
<!-- 画像複数枚の場合のサムネイル -->
<ul class="thum_list js-thum-list view_pc">
<?php foreach($thumbnail_images as $image_index => $image) : ?>
<?php
$imageUrl = ($image && $image->hasItem()) ? $view['image']->getMediaUrl($image, 65, 49, 'contain') : null;
?>
<li date-target="show<?php echo $item_index + 1; ?>-<?php echo $image_index + 1; ?>">
<div><?php lazyImage('', ["65/49"], $imageUrl, $image->getAlt()); ?></div>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</a>
</section>
<?php endforeach; ?>
</div><!-- /.results_inner-->
<?php endif; ?>