Skip to content

Commit

Permalink
added body lower, full width middle and body bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
boznik committed Apr 26, 2017
1 parent 5873362 commit 91843f3
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
49 changes: 47 additions & 2 deletions stanford_soe_regions.module
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,28 @@
function stanford_soe_regions_define_regions() {
$region['full_width_super_hero'] = array(
'title' => 'Full Width Super Hero',
'js' => drupal_get_path('module', 'stanford_soe_regions') . '/js/stanford_soe_regions.js',
'css' => drupal_get_path('module', 'stanford_soe_regions') . '/css/stanford_soe_regions.css',
//'js' => drupal_get_path('module', 'stanford_soe_regions') . '/js/stanford_soe_regions.js',
//'css' => drupal_get_path('module', 'stanford_soe_regions') . '/css/stanford_soe_regions.css',
'render_callback' => '_full_width_super_hero_render_region',
);
$region['content_body_lower'] = array(
'title' => 'Content Body Lower',
//'js' => drupal_get_path('module', 'stanford_soe_regions') . '/js/stanford_soe_regions.js',
//'css' => drupal_get_path('module', 'stanford_soe_regions') . '/css/stanford_soe_regions.css',
'render_callback' => '_content_body_lower_render_region',
);
$region['full_width_middle'] = array(
'title' => 'Full Width Middle',
//'js' => drupal_get_path('module', 'stanford_soe_regions') . '/js/stanford_soe_regions.js',
//'css' => drupal_get_path('module', 'stanford_soe_regions') . '/css/stanford_soe_regions.css',
'render_callback' => '_full_width_middle_render_region',
);
$region['content_body_bottom'] = array(
'title' => 'Content Body Lower',
//'js' => drupal_get_path('module', 'stanford_soe_regions') . '/js/stanford_soe_regions.js',
//'css' => drupal_get_path('module', 'stanford_soe_regions') . '/css/stanford_soe_regions.css',
'render_callback' => '_content_body_bottom_render_region',
);
return $region;
}

Expand All @@ -27,6 +45,33 @@ function _full_width_super_hero_render_region($block_html, $block) {
return $output;
}

/**
* Helper function for rendering the blocks in this region
*/
function _content_body_lower_render_region($block_html, $block) {
$renderable_block = _block_get_renderable_array(array($block));
$output = drupal_render($renderable_block);
return $output;
}

/**
* Helper function for rendering the blocks in this region
*/
function _full_width_middle_render_region($block_html, $block) {
$renderable_block = _block_get_renderable_array(array($block));
$output = drupal_render($renderable_block);
return $output;
}

/**
* Helper function for rendering the blocks in this region
*/
function _content_body_bottom_render_region($block_html, $block) {
$renderable_block = _block_get_renderable_array(array($block));
$output = drupal_render($renderable_block);
return $output;
}

/**
* Implements hook_page_alter().
*/
Expand Down
18 changes: 18 additions & 0 deletions templates/digital-magazine-page.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,24 @@
</div>
</div>
<!-- /#main, /#main-wrapper -->
<?php if ($page['content_body_lower']): ?>
<div id="content-body-lower" class="container">
<div class="row-fluid content-body"> <?php print render($page['content_body_lower']); ?> </div>
</div>
<?php endif; ?>
<!-- /#content-body-lower -->
<?php if ($page['full_width_middle']): ?>
<div id="full-width-middle" class="row-fluid fullwidth">
<div class="container"> <?php print render($page['full_width_middle']); ?> </div>
</div>
<?php endif; ?>
<!-- /#full-width-middle -->
<?php if ($page['content_body_bottom']): ?>
<div id="content-body-bottom" class="container">
<div class="row-fluid content-body"> <?php print render($page['content_body_bottom']); ?> </div>
</div>
<?php endif; ?>
<!-- /#content-body-bottom -->
<?php if ($page['fullwidth_bottom']): ?>
<div id="fullwidth-bottom" class="row-fluid fullwidth">
<div class="container"> <?php print render($page['fullwidth_bottom']); ?> </div>
Expand Down

0 comments on commit 91843f3

Please sign in to comment.