<?php
/**
 * Created by PhpStorm.
 * User: marco
 * Date: 16/07/18
 * Time: 18.44
 */

//function model_view_page()
//{
//	$this_model_view_array = ['main'];
//	return $this_model_view_array;
//}

function page() {
   // $wp_head = get_component('wp_head');
//	$checkChild   = o66TheViewClass::hasViewModelPositionChildren( 'feat_text' );
//	$childText    = 'no child';
//	$childsAppend = '';
//	if ( $checkChild ) {
//		$childText      = '<strong>yes child</strong>';
//		$children_array = o66TheViewClass::getViewModelPositionChildren( 'feat_text' );
//		foreach ( $children_array as $child_comp ) {
//			$childsAppend .= o66TheViewClass::getChildComponent( 'simple_content', $child_comp );
//		}
//	}


    global $post;
    $sidebar_id = get_field('sidebar', $post->ID);

	$content = get_component( 'simple_content' );
	$sidebar = get_component('sidebar');
	if ($sidebar_id !== false) {
        $col_main = html5_div($content, '', 'col-md-8');
        $col_side = html5_div($sidebar, '', 'col-md-4');
    } else {
        $col_main = html5_div($content, '', 'col-md-12');
        $col_side = '';

    }
    $row = html5_div($col_main.$col_side,'','row');
    $container = html5_div($row,null,'container');
    $section = html5_div($container,null,'blok');

	return $section;
}
//get_footer();