Last updated June 10, 2014. Created on March 3, 2012.
Edited by kathc, shakty, csko. Log in to edit this page.

Patterns 7.x can automatically detect the current configuration of each component from the database and save it as a valid pattern file. This extremely useful feature is available from the main Patterns menu, by clicking on 'Export'.

The feature is however still experimental, and the extracted pattern may require minor corrections from the user to run without errors.

Intuitively, the magic can be obtained in two ways:

  • Fully automatic extraction: Patterns calls the 'MODIFY' form of each component to load the data necessary to write the pattern file.
  • Patterns built by the component: component developers have full control on what to return as extracted pattern.

Although it is not, strictly speaking, a dependency of Patterns, some of the components may require the Macro module to be enabled for the automated export functionality.

If you are interested in implementing automatic extraction of pattern files from the database for your module please read the section writing an export function for a Patterns component.

Looking for support? Visit the forums, or join #drupal-support in IRC.