deviceDetect->isMobile(); $maxheight = $mobile?'900':'750'; if($gallery instanceof \app\models\front\Gallery && count($gallery->getBehavior('galleryBehavior')->getImages())>0 ){ $nav = 'thumbs'; $ratio = ''; $c = Yii::$app->acache; $c->set('fotorama', true); $i=1; ob_start(); foreach($gallery->getBehavior('galleryBehavior')->getImages() as $image){ $add_cap = ($image->name != '')?", caption: '".$image->name."'":''; $mainimg = false; if( $image->type == 'post_gallery' ){ if( ( $model->type == 2 || $model->type == 6 ) && !$mobile ){ // лонгрид $mainimg = $image->getUrl('large'); }else{ $mainimg = $image->getUrl('medium'); } } if( $mainimg ){ $d = str_replace("\n", "", (string)$image->description); $u = trim($d); if( $u ){ $d = ', html:'.json_encode('