1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Implimentation of an Adaptivetheme Page Layout plugin
|
6
|
*
|
7
|
* This is an example of a Page Layout plugin for Adaptivetheme. If enabled this
|
8
|
* will be picked up by the Plugin system and added as a page layout option for
|
9
|
* the specified 'device_groups'.
|
10
|
*
|
11
|
* You can enable the "naked" example layout plugin by uncommenting the
|
12
|
* info file entry in your subthemes info file. Look for:
|
13
|
* Custom Page Layout Plugins:
|
14
|
* plugins[page_layout][layouts] = custom_layouts
|
15
|
*
|
16
|
* Where "custom_layouts" is the directory holding this file. Remember to clear
|
17
|
* the cache after you make changes to your info file.
|
18
|
*
|
19
|
* The three_col_grail.inc AT Core layout holds extensive documentation on Page
|
20
|
* Layout plugins, its well worth reviewing that file.
|
21
|
*
|
22
|
* NOTE: when making changes to layout plugins you must clear cache all - plugin
|
23
|
* data is cached in the database!
|
24
|
*
|
25
|
* @SEE adaptivetheme/at_core/layouts/core/three_col_grail/three_col_grail.inc
|
26
|
* @SEE at_subtheme.info (Custom Page Layout Plugins).
|
27
|
*/
|
28
|
function naked() {
|
29
|
$page_layout['naked'] = array(
|
30
|
'title' => t('Naked'),
|
31
|
'category' => t('AT Subtheme Custom Page Layout'),
|
32
|
'method' => 'naked',
|
33
|
'type' => 'page_layout',
|
34
|
'admin css' => 'naked.admin.css',
|
35
|
'device_groups' => array(
|
36
|
'bigscreen',
|
37
|
'tablet_landscape',
|
38
|
'tablet_portrait',
|
39
|
'smalltouch_landscape',
|
40
|
),
|
41
|
);
|
42
|
|
43
|
return $page_layout;
|
44
|
}
|
45
|
|
46
|
/**
|
47
|
* CSS Builder for the naked layout.
|
48
|
*
|
49
|
* Page layout functions are called during theme settings submit to process and
|
50
|
* return CSS to be written to file. Sidebar width and unit values are set in
|
51
|
* theme settings and passed to this function as parameters.
|
52
|
*
|
53
|
* In essense you just write CSS here using the parameters as placeholders for
|
54
|
* inserting the values. You might do some logic with those values first
|
55
|
* depending on the complexity and nature of your layout. Its worth taking some
|
56
|
* time to review AT Cores Page layouts for examples.
|
57
|
*
|
58
|
* @param $sidebar_first, an arbitary numeric value.
|
59
|
* @param $sidebar_second, an arbitary numeric value.
|
60
|
* @param $sidebar_unit, a value unit, one of px, em or %.
|
61
|
*/
|
62
|
function naked_layout($sidebar_first, $sidebar_second, $sidebar_unit) {
|
63
|
$styles = <<<EOF
|
64
|
/* Nothing to output, this style is naked! */
|
65
|
EOF;
|
66
|
|
67
|
return $styles;
|
68
|
}
|