Projet

Général

Profil

Paste
Télécharger (1,5 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / mayo / layouts / core / one_col_stack / one_col_stack.inc @ f066bdb5

1
<?php
2

    
3
/**
4
 * @file
5
 * Implimentation of a Page Layout Plugin for MAYO.
6
 *
7
 * @see three_col_grail.inc for detailed documentation.
8
 */
9
function one_col_stack() {
10
  $page_layout['one_col_stack'] = array(
11
    'title'    => t('One Column Stacked'),
12
    'method'   => 'one_col_stack',
13
    'type'     => 'page_layout',
14
    'device_groups' => array(
15
      'tablet_portrait',
16
      'smalltouch_landscape',
17
     ),
18
  );
19

    
20
  return $page_layout;
21
}
22

    
23
/**
24
 * CSS Builder for the one_col_stack layout.
25
 * Note: this is the only layout for smalltouch portrait, and for mobile first.
26
 * All columns and regions are 100% width, stacked.
27
 *
28
 * @param $sidebar_first, an arbitary numeric value.
29
 * @param $sidebar_second, an arbitary numeric value.
30
 * @param $sidebar_unit, a value unit, one of px, em or %.
31
 */
32
function one_col_stack_layout($sidebar_first, $sidebar_second, $sidebar_unit) {
33
  $styles = <<<EOF
34
#sidebar-first,#sidebar-second {float:none;clear:both;display:block;width:100%;margin-left:0;margin-right:0}
35
#top-columns .column-block-wrapper {width: 100% !important; margin-top: 1em;}
36
#top-columns .column-block-wrapper .column-block {height: auto ; margin: 0 !important;}
37
#bottom-columns .column-block-wrapper {width: 100% !important; margin-top: 1em;}
38
#bottom-columns .column-block-wrapper .column-block {height: auto ; margin: 0 !important;}
39
#footer-columns .column-block-wrapper {width: 100% !important; margin-top: 1em;}
40
#footer-columns .column-block-wrapper .column-block {height: auto ; margin: 0 !important;}
41
EOF;
42

    
43
  return $styles;
44
}