function display($bodyLayout = 'mainbody', $sidebarLayout = 'sidebar', $sidebarChrome = 'standard', $contentTopLayout = 'standard', $contentTopChrome = 'standard', $contentBottomLayout = 'standard', $contentBottomChrome = 'standard', $grid = null)
 {
     global $gantry;
     global $wp_registered_sidebars, $wp_registered_widgets;
     if ($grid == null) {
         $grid = GRID_SYSTEM;
     }
     // get sidebar count
     $sidebars_widgets = wp_get_sidebars_widgets();
     $sidebarCount = GantryMainBodyRenderer::countSidebars($sidebars_widgets['sidebar']);
     $columnCount = $sidebarCount + 1;
     //here we would see if the mainbody schema was set to soemthing else
     $defaultSchema = $gantry->mainbodySchemas[$grid][$columnCount];
     $mbp = $gantry->get('mainbodyPosition');
     $position = @unserialize($mbp);
     if (!isset($position[$grid]) || !isset($position[$grid]) || !array_key_exists($columnCount, $position[$grid])) {
         $schema = $defaultSchema;
     } else {
         $schema = $position[$grid][$columnCount];
     }
     // If RTL then flip the array
     if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
         $schema = $gantry->_flipBodyPosition($schema);
     }
     $classKey = $gantry->_getKey($schema);
     $pushPull = $gantry->pushPullSchemas[$classKey];
     $output = '';
     $sidebars = '';
     $contentTop = null;
     $contentBottom = null;
     $index = 1;
     // remove the mainbody and use the schema array for grid sizes
     $sidebarSchema = $schema;
     unset($sidebarSchema['mb']);
     // Add extra data to sidebar
     $sidebar =& $wp_registered_sidebars['sidebar'];
     $sidebar['layout'] = $sidebarLayout;
     $sidebar['chrome'] = $sidebarChrome;
     // clean to max sidebars
     $filtered_widgets = GantryWidgetsRenderer::filterWidgetCount($sidebars_widgets);
     $widgets = $filtered_widgets['sidebar'];
     if (null == $widgets) {
         $widgets = array();
     }
     // Map widgets to sidebars without the dividers
     $widget_map = array();
     $pos = 1;
     $pos_info_set = false;
     if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
         $main_body_pp = array_shift($pushPull);
         $pushPull = array_reverse($pushPull);
         array_unshift($pushPull, $main_body_pp);
     }
     foreach ($widgets as $widget) {
         if (!$pos_info_set) {
             $widget_map[$pos]['gridCount'] = current($sidebarSchema);
             $widget_map[$pos]['pushPull'] = $pushPull[$index++];
             $pos_info_set = true;
         }
         if (preg_match("/^gantrydivider/", $widget)) {
             $pos++;
             $pos_info_set = false;
             next($sidebarSchema);
         } else {
             $widget_map[$pos]['widgets'][$widget] = array('name' => $widget);
         }
     }
     $sidebar['widget_map'] = $widget_map;
     $sidebars = "";
     if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
         add_filter('sidebars_widgets', array('GantryMainBodyRenderer', 'invertPositionOrder'));
     }
     add_filter('dynamic_sidebar_params', array('GantryMainBodyRenderer', 'filterWidget'));
     ob_start();
     dynamic_sidebar('sidebar');
     $sidebars .= ob_get_clean();
     remove_filter('dynamic_sidebar_params', array('GantryMainBodyRenderer', 'filterWidget'));
     if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
         remove_filter('sidebars_widgets', array('GantryMainBodyRenderer', 'invertPositionOrder'));
     }
     if ($gantry->countModules('content-top')) {
         $contentTop = $gantry->displayModules('content-top', $contentTopLayout, $contentTopChrome, $schema['mb']);
     }
     if ($gantry->countModules('content-bottom')) {
         $contentBottom = $gantry->displayModules('content-bottom', $contentBottomLayout, $contentBottomChrome, $schema['mb']);
     }
     $output = $gantry->renderLayout('body_' . $bodyLayout, array('schema' => $schema, 'pushPull' => $pushPull, 'classKey' => $classKey, 'sidebars' => $sidebars, 'contentTop' => $contentTop, 'contentBottom' => $contentBottom));
     return $output;
 }
 /**
  * @param string $bodyLayout
  * @param string $sidebarLayout
  * @param string $sidebarChrome
  * @param string $contentTopLayout
  * @param string $contentTopChrome
  * @param string $contentBottomLayout
  * @param string $contentBottomChrome
  * @param null   $gridsize
  *
  * @return string|void
  */
 public function displayMainbody($bodyLayout = 'mainbody', $sidebarLayout = 'sidebar', $sidebarChrome = 'standard', $contentTopLayout = 'standard', $contentTopChrome = 'standard', $contentBottomLayout = 'standard', $contentBottomChrome = 'standard', $gridsize = null)
 {
     if (defined('GANTRY_FINALIZED')) {
         return '';
     }
     gantry_import('core.renderers.gantrymainbodyrenderer');
     return GantryMainBodyRenderer::display($bodyLayout, $sidebarLayout, $sidebarChrome, $contentTopLayout, $contentTopChrome, $contentBottomLayout, $contentBottomChrome, $gridsize);
 }
 function displayMainbody($bodyLayout = 'mainbody', $sidebarLayout = 'sidebar', $sidebarChrome = 'standard', $contentTopLayout = 'standard', $contentTopChrome = 'standard', $contentBottomLayout = 'standard', $contentBottomChrome = 'standard')
 {
     gantry_import('core.renderers.gantrymainbodyrenderer');
     return GantryMainBodyRenderer::display($bodyLayout, $sidebarLayout, $sidebarChrome, $contentTopLayout, $contentTopChrome, $contentBottomLayout, $contentBottomChrome);
 }