Skip to content

Instantly share code, notes, and snippets.

@VeggieMeat
Last active August 29, 2015 14:00
Show Gist options
  • Save VeggieMeat/11339385 to your computer and use it in GitHub Desktop.
Save VeggieMeat/11339385 to your computer and use it in GitHub Desktop.
cTools Panels Layout Plugin - see http://www.vmdoh.com/about-us for the layout in the main content area
<?php
/**
* @file
* Template for 1x2x1x1 layout.
*
* This template provides a two column layout split 8/4 with a full row above
* and two full rows below.
*
* Variables:
* - $id: An optional CSS id to use for the layout.
* - $content: An array of content, each item in the array is keyed to one
* panel of the layout. This layout supports the following sections:
* - $content['hgroup']: Content in the first full row.
* - $content['content']: Content in the left column.
* - $content['aside']: Content in the right column.
* - $content['call_to_action']: Content in the second full row.
* - $content['team_members']: Content in the second full row.
*/
?>
<section class="hgroup">
<div class="container">
<?php print $content['hgroup']; ?>
</div>
</section>
<section class="article-text">
<div class="container">
<div class="row">
<div class="col-sm-8 col-md-8">
<?php print $content['content']; ?>
</div>
<div class="col-sm4 col-md-4">
<?php print $content['aside']; ?>
</div>
</div>
</div>
</section>
<section class="call_to_action">
<div class="container">
<?php print $content['call_to_action']; ?>
</div>
</section>
<section class="team_members">
<div class="container">
<?php print $content['team_members']; ?>
</div>
</section>
/**
* Only need the part of the CSS necessary for the layout to display properly
* in Panels UI. The theme CSS loads after this on a regular page, so anything
* that you do here can be overridden by your theme without issue.
*/
.col-md-8 {
float: left;
width: 66.66666666666666%;
}
.col-md-4 {
float: left;
width: 33.33333333333333%;
}
.row::after {
clear: both;
}
.call_to_action {
clear:both;
}
<?php
// Plugin definition
$plugin = array(
'title' => t('Layout 1x2x1x1'),
'category' => t('Columns: 2'),
'icon' => 'layout_1211.png',
'theme' => 'layout_1211',
'css' => 'layout_1211.css',
'regions' => array(
'hgroup' => t('Header'),
'content' => t('Content'),
'aside' => t('Aside'),
'call_to_action' => t('Call to Action'),
'team_members' => t('Team')
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment