Issue #2113611 by mstef: [Fatal error] hook_requirements() not returning anything
[project/context.git] / context_layouts / README.txt
... / ...
CommitLineData
1
2Context layouts
3---------------
4Context layouts provides a formalized way for themes to declare and switch
5between page templates using Context. It is a continuation of an old Drupal
6themer's trick to switch to something besides the standard `page.tpl.php` file
7for a variety of special-case pages like the site frontpage, login page, admin
8section, etc.
9
10
11Requirements
12------------
13In order to use context layouts, your site must meet a few conditions:
14
15- Context and Context layouts modules are enabled (`admin/build/modules`).
16- You are using a theme which provides and has declared multiple layouts. (See
17 "Example themes" for themes you can try.)
18
19
20Basic usage
21-----------
22Once you have layouts enabled, you can have a context trigger the usage of a
23particular layout in either the admin interface (`admin/build/context`) or
24inline context editor. Different layouts may have fewer or greater regions than
25the default page template, so adjust your blocks accordingly.
26
27
28Supporting context layouts in your theme
29----------------------------------------
30You can add layouts support to your theme by declaring additional layouts in
31your theme's info file. Here is an example:
32
33`example.info`
34
35 name = "Example"
36 description = "Example theme"
37 core = "6.x"
38 engine = "phptemplate"
39
40 regions[left] = "Left sidebar"
41 regions[right] = "Right sidebar"
42 regions[content] = "Content"
43 regions[footer] = "Footer"
44
45 ; Layout: Default
46 layouts[default][name] = "Default"
47 layouts[default][description] = "Simple two column page."
48 layouts[default][template] = "page"
49 layouts[default][regions][] = "content"
50 layouts[default][regions][] = "right"
51
52 ; Layout: Columns
53 layouts[columns][name] = "3 columns"
54 layouts[columns][description] = "Three column page."
55 layouts[columns][stylesheet] = "layout-columns.css"
56 layouts[columns][template] = "layout-columns"
57 layouts[columns][regions][] = "left"
58 layouts[columns][regions][] = "content"
59 layouts[columns][regions][] = "right"
60 layouts[columns][regions][] = "footer"
61
62Each layout is declared under `layouts` with the key as the identifier that will
63be used by context for this layout. You may use any reasonable machine name for
64each layout, but note that `default` is special -- it will be the default layout
65for your theme if no other layout is specified.
66
67The following keys can be declared for each layout:
68
69- `name`: The human readable name for this layout, shown in the admin UI.
70- `description`: A short description of your layout, same as above.
71- `stylesheet`: A stylesheet to be included with the layout. Optional.
72- `template`: The name of the template file for this layout, without the
73 `.tpl.php` extension.
74- `region`: An array of regions supported by this layout. Note that any of the
75 regions listed here **must also be declared** in the standard theme `regions`
76 array.
77
78
79Example themes
80--------------
81- Cube, a subtheme included with [Rubik][1] provides a variety of layouts.
82- [Ginkgo][2] the default theme included with Open Atrium.
83
84[1]: http://github.com/developmentseed/rubik/downloads
85[2]: http://github.com/developmentseed/ginkgo/downloads