Last updated March 4, 2013. Created by shakty on March 2, 2012.
Edited by drozas, csko. Log in to edit this page.

Patterns is installed as a normal Drupal module. Its dependencies are the Token and Libraries modules. In order to enable automatic extraction of Patterns files from the database, the Macro module must be installed as well.

Moreover, Patterns makes uses of two external libraries that should be installed separately: Spyc and Codemirror.

  • Spyc is a native PHP library used to parse YAML files. It is necessary for running YAML-based patterns, and it should be installed under sites/all/libraries/spyc

  • Codemirror is a Javascript library which considerably enhances the interface of the Patterns editor page. It is not necessary for the correct functioning of Patterns, but recommended.
    Patterns 7.x-2.x supports Codemirror 3. In case you want to use it the library should be installed under sites/all/libraries/codemirror-3.0.
    Patterns 7.x-1.x supports Codemirror 2. In case you want to use it the library should be installed under sites/all/libraries/codemirror2.

Patterns Submodules

After installing Patterns, you probably need to enable some of its submodules as well. Here follows a brief explanation.

  • The Patterns Components submodule allows the Patterns engine to handle different Patterns tags (e.g. node, vocabulary, term, etc.). By default no tag is allowed.
  • The Patterns Parsers submodules enables parsing (read / write) of different formats (XML, YAML and PHP available)
  • The Patterns Examples adds several examples files about how to write patterns.

Drush Makefile

  1. Download and extract Drush.

  2. Change into your (possibly empty) target directory in your webroot.

  3. Run the makefile: PATH_TO_drush/drush make PATH_TO_patterns.make

  4. Your directory structure should be ready to use.

Installation Profile

The Patterns Installation Profile can be found at http://drupal.org/project/patterns_profile, but in the current version only Patterns 7.x-1.x is supported.

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