You are here

debutf.txt in Debut 6

Same filename and directory in other branches
  1. 7 debutf.txt
Debut Feature Specification (debutf 1.0-draft)
----------------------------------------------
Extending the kitf feature specification, this document provides a set of
requirements for Drupal features to provide suitable baseline functionality
suitable to various distributions and individual site installs and at the same
time integrate effectively into a cohesive feature set. Debut features should
together provide an integrated set of functionality that covers the basic needs
of most Drupal websites and distributions.

This document is based on the Drupal 6.x versions of Drupal core, contributed
modules and themes.


1. Introduction
---------------
The kitf feature specification provides important guidelines and requirements
to ensure interoperability among Drupal features.

Building on kitf, Debut features are based on the following precepts:

* Debut features should provide the basic functionality that most sites or
distributions will need.
* Any advanced or specialized functionality should be provided in separate
features that require more basic features.
* Website feature discoverability and ease of use for both admins and end users
should be an overriding goal.
* Every main task should have only one primary admin interface.
* Common protocols and solutions should be used to ensure consistency and ease
of use.

### Uniqueness and compatibility

Wherever possible, each Debut feature should cover a unique area of
functionality. For example, there should be only a single Debut feature that
provides general blog functionality. Exceptions can be made where the
underlying framework used is radically different and there is no common base to
build on. For example, a debut_search feature could provide search enhancements
based on core Drupal search while a debut_searchlight feature provided search
through Searchlight.

### Available on the Drupal infrastructure

To ensure visibility, all Debut features should be hosted on the Drupal
infrastructure.

### Declaring compliance

Features compliant with this specification may declare themselves as such in
their module `.info` file using the `debutf` key and the version of this
document to which they comply. Example:

    debutf = "1.0-draft"

### Features framework

A feature should meet its needs through Features-aware solutions wherever
possible. Where multiple options exist, a primary selection criterion should be
how fully they embrace the Features framework.

- Context: Where context or contextual layout is required, the Context module
should be used.
- Boxes: Where custom blocks are required, the Boxes module must be used.
- Strongarm: Where variables are set, the Strongarm module should be used.
- Spaces: Where individual items (user spaces, pieces of content) require
contextual customization, the Spaces module should be used.

One of the most challenging tasks for novice site admins is controlling layout
of individual sections or pages. The Panels module is a highly advanced and
powerful solution for this purpose, but using Panels in combination with Context
is demanding and error-prone. If e.g. a node type is overridden with a panel page,
this panels page must be created by a single feature--barring custom coding,
there is no easy way for other features to selectively add panes such that the
overall panels page is constructed from the contributions of whatever other
features are enabled. For this reason, Context rather than Panels seems the best
overall choice for building displays in Debut.

However, Panels provides much greater flexibility and power in building complex,
customized layouts than Context does.

Therefore, Debut features providing complex layout may use Mini-Panels, which can
themselves be positioned and displayed via Context. This approach may give some
of the power of Panels while retaining the overall use of Context for piecing
together displays from the components offered by multiple features.

### Standard solutions

To help produce uniformity among the various Debut features, standard solutions
are adopted across Debut. For example, for mapping, there are several Drupal
modules available, e.g., Gmap, OpenLayers. To ensure consistency, one should be
designated as the Debut standard.

In selecting between alternatives, the Drupal principles are to be used as well
as the following additional criteria:

* Community open source: the candidate solution is a community-driven open source
solution.
* Non-proprietary: The candidate solution is not limited to, branded by, or
controlled by a single company.
* Data security: The candidate solution does not require posting data to an
external source unless doing so is the explicit purpose.
* Works out of the box without requiring manual configuration, e.g., entry of
an API key.

Before introducing a new Debut feature that introduces a dependency that could
be considered as a new standard solution, an issue must be posted on the Debut
project proposing the new standard solution with justification.

Adopted standard solutions:

- Captcha: where forms are protected from automated submission, the Captcha
module should be used.
- OpenLayers: where client side mapping is required, the OpenLayers Drupal module
should be used.
- Pathauto: where appropriate, paths variables should be set so that, if Pathauto
is present, content types defined by a feature will get appropriate paths.
- Rules should be used and not the core Trigger module for any configurable
actions.

### Opportunity for peer review

There should be an opportunity for review prior to a new Debut feature being posted.
Such review will help ensure that new features indeed meet the Debut spec, e.g.,

* identify any potential components that could/should be pulled into more specific
Debut features,
* identify properties that are too site-specific to warrant inclusion in Debut,
* if the feature introduces a new solution to standardize (e.g., an external library
or a way to structure particular data), ensure a consensus prior to adoption.

Therefore each proposed Debut feature should be posted first as an issue on the
Debut project, with a link to the sandbox version of the proposed feature and
two weeks allowed for peer review prior to the new feature being promoted from
a sandbox project to a full project on drupal.org.


2. Namespaces
-------------

### 2.1 Code namespace

A Debut feature must include the debut namespace.

- Example: `debut_blog`.


### 2.2 Project namespace

A Debut project must include the debut namespace.

- Example: `debut_blog`.


3. User roles and permissions
-----------------------------

### 3.1 Required user roles

The `administrator` role defined in kitf should be used for site administration
tasks, such as installing and configuring modules, content types, and blocks.
The administrator role is defined by the Debut feature and so should not be
defined by any other Debut feature.

In addition to the three roles defined in kitf, features should use the
following two roles as appropriate.

- `contributor` is a Drupal user who contributes content, e.g., a staff member
at an organization or company.
- `editor` is a Drupal user responsible for editing and administrating content,
taxonomies, and comments.

No additional roles may be provided by a feature.

These roles are provided by the Debut feature and so will be present if Debut
is installed. However, to avoid unwanted roles, Debut features should avoid
requiring the Debut feature if feasible.

### 3.2 Permissions

The editor role should not be expected to have `administer nodes` permissions.

For each content type introduced, roles should be assigned as follows:

- `contributor`: `create [type] content`, `delete own [type] content`, `edit
own [type] content`
- `editor`: `create [type] content`, `delete all [type] content`, `edit all
[type] content`

where [type] is the machine name of the content type being introduced by the
feature.


4. Variables
------------
A feature should include a settings form for any variables important to it.
Doing so will facilitate Spaces integration.


5. Paths and breadcrumbs
-----------------------

### 5.1 Primary path and nesting

Where a feature provides content or nested pages, these should wherever feasible
be available at paths nested below the feature's primary path.

Without creating a dependency on Pathauto, a feature that defines a content
type should register a pathauto pattern variable that nests content of that type
below the feature's primary page.

Example: a blog feature would use Strongarm to set pathauto_node_audio_pattern
to 'blog/[title-raw]'.


### 5.2 Menu location and breadcrumbs

Menu location and breadcrumbs for pages created by the feature should match the
nesting used for paths.

Context should be used to set breadcrumbs. For example, an article feature
including an article content type and an article landing page at 'article'
should set a context breadcrumb reaction on article node pages pointing to
the 'article' menu item.

Currently context includes a menu class reaction but doesn't set the menu
trail.

See http://drupal.org/node/835090 for a potential menu trail context reaction.


6. Block visibility and theme regions
-------------------------------------

### 6.1 Block visibility

The Context module should be used wherever feasible for block placement and
visibility. 

### 6.2 Theme regions

Only the theme regions specified in kitf may be used. The right sidebar region
should be used primarily, with only occasional, supplemental blocks being
assigned to the left sidebar.


7. Dependencies
---------------
A feature may not depend on any feature that is not fully compliant with this
specification.

### Versions

Wherever feasible, features should use the recommended stable release versions
of contributed modules and themes.

Exceptions:

* If jQuery Update is used, the 6.x-2.x branch should be used.
* If Captcha is used, the 6.x.2.x-dev release should be used until 
http://drupal.org/node/704110 reaches stable.

### Libraries

Any external libraries used by a feature should be installed in a libraries
directory if possible.

### Patches

Patches should be avoided wherever possible. Ideally, patches should be used
only up to and including beta releases, to include functionality expected
to reach stable releases by the time the feature is out of beta.

Where feasible, patches should be replaced with workarounds in a feature's
.module file that use Drupal APIs to achieve the same ends. These workarounds
should include documentation identifying the patch that they relate to so
they can be removed if/when that patch is accepted.

### Drush make file

A feature should include a sample Drush make file including all the feature's
dependencies (modules, external libraries, etc.) that would typically be
installed with the feature.

To avoid being automatically processed by Drush Make, make files should end
with a .example extension.

For example, a debut_wysiwyg feature might include debut_wysiwyg.make.example
including the wysiwyg project and a WYSIWYG library like tinymce or ckeditor.

To ensure that any modules or libraries declared in one feature don't duplicate
those in another, the following path convention must be used:

- contrib: used for all code in Drupal's version control
- external: used for modules, themes, etc. hosted externally, e.g., modules at http://code.developmentseed.org

Examples:

; A drupal.org hosted project.
projects[jquery_ui][subdir] = contrib
; An externally hosted project.
projects[seed][subdir] = external
projects[seed][location] = http://code.developmentseed.org/fserver
; A library required by a contrib module.
libraries[jquery_ui][download][type] = "get"
libraries[jquery_ui][download][url] = "http://jquery-ui.googlecode.com/files/
jquery-ui-1.7.3.zip"
libraries[jquery_ui][directory_name] = "jquery.ui"
libraries[jquery_ui][destination] = "modules/contrib/jquery_ui"


8. Content types
----------------

Where a feature defines a content type, the following guidelines should be
followed:

### Image fields

* If images are used with the content type, the feature should depend on the
Debut Image feature and use its imagecache presets wherever possible.


9. Views
--------

For consistency, the following conventions should be used for veiws included in
features.

* Naming: if the view is primarily for presenting a single content type, it
should be named for the machine name of that content type.
* At a minimum, views of a content type should include a page, block, and feed 
display, with the feed display attached to both the page and block. The page
display should have a path matching the content type's machine name and the feed
should have the same path with an .xml extension.


10. Contexts
-----------

Where appropriate, features that define a content type should include a context
that displays related content on node pages of that content type. For example,
an event feature might display a calendar block and an upcoming events block
when event content is being viewed.

For consistency, unless there are extenuating reasons, such contextual blocks
should be placed in the right region.


11. Help
--------

A feature should include contextual help provided through the Advanced Help
module covering all major components of the feature. For example, a debut_audio
feature including an audio content type with an embedded audio field, a view, and
a context might include help on all the following:

* The content type.
* How to embed an audio file.
* For each enabled embedded audio provider, specific instructions on posting
audio.

File

debutf.txt
View source
  1. Debut Feature Specification (debutf 1.0-draft)
  2. ----------------------------------------------
  3. Extending the kitf feature specification, this document provides a set of
  4. requirements for Drupal features to provide suitable baseline functionality
  5. suitable to various distributions and individual site installs and at the same
  6. time integrate effectively into a cohesive feature set. Debut features should
  7. together provide an integrated set of functionality that covers the basic needs
  8. of most Drupal websites and distributions.
  9. This document is based on the Drupal 6.x versions of Drupal core, contributed
  10. modules and themes.
  11. 1. Introduction
  12. ---------------
  13. The kitf feature specification provides important guidelines and requirements
  14. to ensure interoperability among Drupal features.
  15. Building on kitf, Debut features are based on the following precepts:
  16. * Debut features should provide the basic functionality that most sites or
  17. distributions will need.
  18. * Any advanced or specialized functionality should be provided in separate
  19. features that require more basic features.
  20. * Website feature discoverability and ease of use for both admins and end users
  21. should be an overriding goal.
  22. * Every main task should have only one primary admin interface.
  23. * Common protocols and solutions should be used to ensure consistency and ease
  24. of use.
  25. ### Uniqueness and compatibility
  26. Wherever possible, each Debut feature should cover a unique area of
  27. functionality. For example, there should be only a single Debut feature that
  28. provides general blog functionality. Exceptions can be made where the
  29. underlying framework used is radically different and there is no common base to
  30. build on. For example, a debut_search feature could provide search enhancements
  31. based on core Drupal search while a debut_searchlight feature provided search
  32. through Searchlight.
  33. ### Available on the Drupal infrastructure
  34. To ensure visibility, all Debut features should be hosted on the Drupal
  35. infrastructure.
  36. ### Declaring compliance
  37. Features compliant with this specification may declare themselves as such in
  38. their module `.info` file using the `debutf` key and the version of this
  39. document to which they comply. Example:
  40. debutf = "1.0-draft"
  41. ### Features framework
  42. A feature should meet its needs through Features-aware solutions wherever
  43. possible. Where multiple options exist, a primary selection criterion should be
  44. how fully they embrace the Features framework.
  45. - Context: Where context or contextual layout is required, the Context module
  46. should be used.
  47. - Boxes: Where custom blocks are required, the Boxes module must be used.
  48. - Strongarm: Where variables are set, the Strongarm module should be used.
  49. - Spaces: Where individual items (user spaces, pieces of content) require
  50. contextual customization, the Spaces module should be used.
  51. One of the most challenging tasks for novice site admins is controlling layout
  52. of individual sections or pages. The Panels module is a highly advanced and
  53. powerful solution for this purpose, but using Panels in combination with Context
  54. is demanding and error-prone. If e.g. a node type is overridden with a panel page,
  55. this panels page must be created by a single feature--barring custom coding,
  56. there is no easy way for other features to selectively add panes such that the
  57. overall panels page is constructed from the contributions of whatever other
  58. features are enabled. For this reason, Context rather than Panels seems the best
  59. overall choice for building displays in Debut.
  60. However, Panels provides much greater flexibility and power in building complex,
  61. customized layouts than Context does.
  62. Therefore, Debut features providing complex layout may use Mini-Panels, which can
  63. themselves be positioned and displayed via Context. This approach may give some
  64. of the power of Panels while retaining the overall use of Context for piecing
  65. together displays from the components offered by multiple features.
  66. ### Standard solutions
  67. To help produce uniformity among the various Debut features, standard solutions
  68. are adopted across Debut. For example, for mapping, there are several Drupal
  69. modules available, e.g., Gmap, OpenLayers. To ensure consistency, one should be
  70. designated as the Debut standard.
  71. In selecting between alternatives, the Drupal principles are to be used as well
  72. as the following additional criteria:
  73. * Community open source: the candidate solution is a community-driven open source
  74. solution.
  75. * Non-proprietary: The candidate solution is not limited to, branded by, or
  76. controlled by a single company.
  77. * Data security: The candidate solution does not require posting data to an
  78. external source unless doing so is the explicit purpose.
  79. * Works out of the box without requiring manual configuration, e.g., entry of
  80. an API key.
  81. Before introducing a new Debut feature that introduces a dependency that could
  82. be considered as a new standard solution, an issue must be posted on the Debut
  83. project proposing the new standard solution with justification.
  84. Adopted standard solutions:
  85. - Captcha: where forms are protected from automated submission, the Captcha
  86. module should be used.
  87. - OpenLayers: where client side mapping is required, the OpenLayers Drupal module
  88. should be used.
  89. - Pathauto: where appropriate, paths variables should be set so that, if Pathauto
  90. is present, content types defined by a feature will get appropriate paths.
  91. - Rules should be used and not the core Trigger module for any configurable
  92. actions.
  93. ### Opportunity for peer review
  94. There should be an opportunity for review prior to a new Debut feature being posted.
  95. Such review will help ensure that new features indeed meet the Debut spec, e.g.,
  96. * identify any potential components that could/should be pulled into more specific
  97. Debut features,
  98. * identify properties that are too site-specific to warrant inclusion in Debut,
  99. * if the feature introduces a new solution to standardize (e.g., an external library
  100. or a way to structure particular data), ensure a consensus prior to adoption.
  101. Therefore each proposed Debut feature should be posted first as an issue on the
  102. Debut project, with a link to the sandbox version of the proposed feature and
  103. two weeks allowed for peer review prior to the new feature being promoted from
  104. a sandbox project to a full project on drupal.org.
  105. 2. Namespaces
  106. -------------
  107. ### 2.1 Code namespace
  108. A Debut feature must include the debut namespace.
  109. - Example: `debut_blog`.
  110. ### 2.2 Project namespace
  111. A Debut project must include the debut namespace.
  112. - Example: `debut_blog`.
  113. 3. User roles and permissions
  114. -----------------------------
  115. ### 3.1 Required user roles
  116. The `administrator` role defined in kitf should be used for site administration
  117. tasks, such as installing and configuring modules, content types, and blocks.
  118. The administrator role is defined by the Debut feature and so should not be
  119. defined by any other Debut feature.
  120. In addition to the three roles defined in kitf, features should use the
  121. following two roles as appropriate.
  122. - `contributor` is a Drupal user who contributes content, e.g., a staff member
  123. at an organization or company.
  124. - `editor` is a Drupal user responsible for editing and administrating content,
  125. taxonomies, and comments.
  126. No additional roles may be provided by a feature.
  127. These roles are provided by the Debut feature and so will be present if Debut
  128. is installed. However, to avoid unwanted roles, Debut features should avoid
  129. requiring the Debut feature if feasible.
  130. ### 3.2 Permissions
  131. The editor role should not be expected to have `administer nodes` permissions.
  132. For each content type introduced, roles should be assigned as follows:
  133. - `contributor`: `create [type] content`, `delete own [type] content`, `edit
  134. own [type] content`
  135. - `editor`: `create [type] content`, `delete all [type] content`, `edit all
  136. [type] content`
  137. where [type] is the machine name of the content type being introduced by the
  138. feature.
  139. 4. Variables
  140. ------------
  141. A feature should include a settings form for any variables important to it.
  142. Doing so will facilitate Spaces integration.
  143. 5. Paths and breadcrumbs
  144. -----------------------
  145. ### 5.1 Primary path and nesting
  146. Where a feature provides content or nested pages, these should wherever feasible
  147. be available at paths nested below the feature's primary path.
  148. Without creating a dependency on Pathauto, a feature that defines a content
  149. type should register a pathauto pattern variable that nests content of that type
  150. below the feature's primary page.
  151. Example: a blog feature would use Strongarm to set pathauto_node_audio_pattern
  152. to 'blog/[title-raw]'.
  153. ### 5.2 Menu location and breadcrumbs
  154. Menu location and breadcrumbs for pages created by the feature should match the
  155. nesting used for paths.
  156. Context should be used to set breadcrumbs. For example, an article feature
  157. including an article content type and an article landing page at 'article'
  158. should set a context breadcrumb reaction on article node pages pointing to
  159. the 'article' menu item.
  160. Currently context includes a menu class reaction but doesn't set the menu
  161. trail.
  162. See http://drupal.org/node/835090 for a potential menu trail context reaction.
  163. 6. Block visibility and theme regions
  164. -------------------------------------
  165. ### 6.1 Block visibility
  166. The Context module should be used wherever feasible for block placement and
  167. visibility.
  168. ### 6.2 Theme regions
  169. Only the theme regions specified in kitf may be used. The right sidebar region
  170. should be used primarily, with only occasional, supplemental blocks being
  171. assigned to the left sidebar.
  172. 7. Dependencies
  173. ---------------
  174. A feature may not depend on any feature that is not fully compliant with this
  175. specification.
  176. ### Versions
  177. Wherever feasible, features should use the recommended stable release versions
  178. of contributed modules and themes.
  179. Exceptions:
  180. * If jQuery Update is used, the 6.x-2.x branch should be used.
  181. * If Captcha is used, the 6.x.2.x-dev release should be used until
  182. http://drupal.org/node/704110 reaches stable.
  183. ### Libraries
  184. Any external libraries used by a feature should be installed in a libraries
  185. directory if possible.
  186. ### Patches
  187. Patches should be avoided wherever possible. Ideally, patches should be used
  188. only up to and including beta releases, to include functionality expected
  189. to reach stable releases by the time the feature is out of beta.
  190. Where feasible, patches should be replaced with workarounds in a feature's
  191. .module file that use Drupal APIs to achieve the same ends. These workarounds
  192. should include documentation identifying the patch that they relate to so
  193. they can be removed if/when that patch is accepted.
  194. ### Drush make file
  195. A feature should include a sample Drush make file including all the feature's
  196. dependencies (modules, external libraries, etc.) that would typically be
  197. installed with the feature.
  198. To avoid being automatically processed by Drush Make, make files should end
  199. with a .example extension.
  200. For example, a debut_wysiwyg feature might include debut_wysiwyg.make.example
  201. including the wysiwyg project and a WYSIWYG library like tinymce or ckeditor.
  202. To ensure that any modules or libraries declared in one feature don't duplicate
  203. those in another, the following path convention must be used:
  204. - contrib: used for all code in Drupal's version control
  205. - external: used for modules, themes, etc. hosted externally, e.g., modules at http://code.developmentseed.org
  206. Examples:
  207. ; A drupal.org hosted project.
  208. projects[jquery_ui][subdir] = contrib
  209. ; An externally hosted project.
  210. projects[seed][subdir] = external
  211. projects[seed][location] = http://code.developmentseed.org/fserver
  212. ; A library required by a contrib module.
  213. libraries[jquery_ui][download][type] = "get"
  214. libraries[jquery_ui][download][url] = "http://jquery-ui.googlecode.com/files/
  215. jquery-ui-1.7.3.zip"
  216. libraries[jquery_ui][directory_name] = "jquery.ui"
  217. libraries[jquery_ui][destination] = "modules/contrib/jquery_ui"
  218. 8. Content types
  219. ----------------
  220. Where a feature defines a content type, the following guidelines should be
  221. followed:
  222. ### Image fields
  223. * If images are used with the content type, the feature should depend on the
  224. Debut Image feature and use its imagecache presets wherever possible.
  225. 9. Views
  226. --------
  227. For consistency, the following conventions should be used for veiws included in
  228. features.
  229. * Naming: if the view is primarily for presenting a single content type, it
  230. should be named for the machine name of that content type.
  231. * At a minimum, views of a content type should include a page, block, and feed
  232. display, with the feed display attached to both the page and block. The page
  233. display should have a path matching the content type's machine name and the feed
  234. should have the same path with an .xml extension.
  235. 10. Contexts
  236. -----------
  237. Where appropriate, features that define a content type should include a context
  238. that displays related content on node pages of that content type. For example,
  239. an event feature might display a calendar block and an upcoming events block
  240. when event content is being viewed.
  241. For consistency, unless there are extenuating reasons, such contextual blocks
  242. should be placed in the right region.
  243. 11. Help
  244. --------
  245. A feature should include contextual help provided through the Advanced Help
  246. module covering all major components of the feature. For example, a debut_audio
  247. feature including an audio content type with an embedded audio field, a view, and
  248. a context might include help on all the following:
  249. * The content type.
  250. * How to embed an audio file.
  251. * For each enabled embedded audio provider, specific instructions on posting
  252. audio.