Skip to content

Instantly share code, notes, and snippets.

@rafaqz
Last active January 11, 2016 13:12
Show Gist options
  • Save rafaqz/5841123 to your computer and use it in GitHub Desktop.
Save rafaqz/5841123 to your computer and use it in GitHub Desktop.
A patch to add extra panels layouts to the drupal zurb-foundation theme
diff --git a/layouts/foundation_2col_stacked_narrow_r/foundation-2col-stacked-narrow-r.tpl.php b/layouts/foundation_2col_stacked_narrow_r/foundation-2col-stacked-narrow-r.tpl.php
new file mode 100644
index 0000000..39eed1e
--- /dev/null
+++ b/layouts/foundation_2col_stacked_narrow_r/foundation-2col-stacked-narrow-r.tpl.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @file
+ * Template for a 2 column panel layout.
+ *
+ * This template provides a two column panel display layout, with
+ * additional areas for the top and the bottom.
+ *
+ * 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['top']: Content in the top row.
+ * - $content['left']: Content in the left column.
+ * - $content['right']: Content in the right column.
+ * - $content['bottom']: Content in the bottom row.
+ */
+?>
+<?php !empty($css_id) ? print '<div id="' . $css_id . '">' : ''; ?>
+ <?php if ($content['top']): ?>
+ <div class="row">
+ <div class="large-12 columns">
+ <?php print $content['top']; ?>
+ </div>
+ </div>
+ <?php endif; ?>
+
+ <div class="row">
+ <div class="large-9 columns">
+ <?php print $content['left']; ?>
+ </div>
+ <div class="large-3 columns">
+ <?php print $content['right']; ?>
+ </div>
+ </div>
+
+ <?php if ($content['bottom']): ?>
+ <div class="row">
+ <div class="large-12 columns">
+ <?php print $content['bottom']; ?>
+ </div>
+ </div>
+ <?php endif; ?>
+<?php !empty($css_id) ? print '</div>' : ''; ?>
diff --git a/layouts/foundation_2col_stacked_narrow_r/foundation_2col_stacked_narrow_r.inc b/layouts/foundation_2col_stacked_narrow_r/foundation_2col_stacked_narrow_r.inc
new file mode 100644
index 0000000..adbe521
--- /dev/null
+++ b/layouts/foundation_2col_stacked_narrow_r/foundation_2col_stacked_narrow_r.inc
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * Implements hook_panels_layouts()
+ */
+function zurb_foundation_foundation_2col_stacked_narrow_r_panels_layouts() {
+ $items['foundation_2col_stacked_narrow_r'] = array(
+ 'title' => t('Foundation: stacked 2 column row narrow right'),
+ 'category' => t('Foundation: 2'),
+ 'icon' => 'foundation_2col_stacked_narrow_r.png',
+ 'theme' => 'foundation_2col_stacked_narrow_r',
+ //'admin css' => '../foundation_panels_admin.css',
+ 'regions' => array(
+ 'top' => t('Top'),
+ 'left' => t('Left'),
+ 'right' => t('Right'),
+ 'bottom' => t('Bottom'),
+ ),
+ );
+ return $items;
+}
+
diff --git a/layouts/foundation_2col_stacked_narrow_r/foundation_2col_stacked_narrow_r.png b/layouts/foundation_2col_stacked_narrow_r/foundation_2col_stacked_narrow_r.png
new file mode 100644
index 0000000..30ab8b6
Binary files /dev/null and b/layouts/foundation_2col_stacked_narrow_r/foundation_2col_stacked_narrow_r.png differ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment