<div id="Container">
  <?php

  echo $this->element(
    Cake\Core\Configure::read('Banners.' . 'home', 'banners/default_section_banners'),
    ['banners' => $banners]
  );

  if (!empty($homepageSections)) {

    foreach ($homepageSections as $sectionSlug => $sectionView) {
      if (!empty($sectionView['subsection'])) {

        echo $this->element(
          Cake\Core\Configure::read('HomeSubSections.' . $sectionView['subsection'], 'body/home/homesubsection_image_title_1'),
          [
            'menuDetails' => $sectionView['subsection'],
            'viewContents' => $sectionView['list'],
          ]
        );

      }

      if (!empty($sectionView['content'])) {

        echo $this->element(
          Cake\Core\Configure::read('Home.' . $sectionSlug, 'body/home/homesection_image_title_1'),
          [
            'menuDetails' => $sectionView['section'],
            'viewContents' => $sectionView['content'],
          ]
        );

      }
    }

  }

  ?>