<?php 
    $icon_name = "icon_" . $atts['icon_type'];
    $iconClass = isset($atts[$icon_name])?$atts[$icon_name]:'';
?>
<div class="cms-fancyboxes-wraper cms-fancyboxes-layout3 <?php echo esc_attr($atts['template']);?>" id="<?php echo esc_attr($atts['html_id']);?>">
    <div class="cms-fancyboxes-body">
        <div class="cms-fancybox-item">
            <?php 
                $image_url = '';
                if (!empty($atts['image'])) {
                    $attachment_image = wp_get_attachment_image_src($atts['image'], 'full');
                    $image_url = $attachment_image[0];
                }
            ?>

            <div class="cms-fancybox-icon">
                <?php if($image_url):?>
                    <span class="fancy-box-image">
                        <img src="<?php echo esc_attr($image_url);?>" />
                    </span>
                <?php else:?>
                    <span class="fancy-box-icon"><i class="<?php echo esc_attr($iconClass); ?>"></i></span>
                <?php endif;?>
            </div>

            <div class="cms-fancybox-content">
                <?php if($atts['description_item']): ?>
                    <div class="cms-fancybox-content-inner">
                        <?php echo apply_filters('the_content',$atts['description_item']);?>
                    </div>
                <?php endif; ?>
                <?php if($atts['title_item']):?>
                    <h3 class="cms-fancybox-title">
                        <?php echo apply_filters('the_title',$atts['title_item']);?>
                    </h3>
                <?php endif;?>
            </div>
            
        </div>
    </div>
</div>