<?php 
/**
 * The template for previewing the sections
 *
 * @package WordPress
 * @subpackage Edition
 * @since Edition 1.0
 */
get_header();

// Make sure full content is displayed
global $more; 
$more = 0; 

// Set first order class
global $tw_order_class;
$tw_order_class = 'first-section'; ?>

<div class="homepage-sections">
	<?php  // get the section type
        $type = get_field('section_type'); 

		// create the correct page template
		switch ($type) {
			case 'section-grid':
				$layout_type = get_field('grid_type');
				$type = $layout_type ? $type . '-' . $layout_type : $type . '-full';
			break;
			case 'section-slider':
				$layout_type = get_field('full_slide_type');
				$type = $layout_type ? $type . '-' . $layout_type : $type . '-full';        		
			break;
			case 'section-full':
				$layout_type = get_field('full_feature_type');
				$type = $layout_type ? $type . '-' . $layout_type : $type . '-full';
			break;
			case 'section-content':
				$layout_type = get_field('content_layout');
				$type = $layout_type ? $type . '-' . $layout_type : $type . '-full';
			break;
		}

		// print the page template 
		get_template_part( TW_TEMPLATES_DIR .'/sections/' . $type );
	?>
</div>

<?php get_footer();