README.txt 3.1 KB

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