Branch: 7.x-1.x
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
includes
modules/patternbuilder_importer
theme
twig
views
.gitignore
LICENSE.txt
README.md
composer.json
patternbuilder.admin.inc
patternbuilder.api.php
patternbuilder.drush.inc
patternbuilder.info
patternbuilder.install
patternbuilder.module
patternbuilder.patternbuilder.inc

README.md

Pattern Builder

The Pattern Builder Module empowers your team to prototype in a static pattern library and then import your designs and content data model into Drupal with a single drush command. Need to update your design? No problem! Just update and QA the code in your pattern library and import those changes in seconds.

Installation

Requirements

Optional Extensions

Setup Walkthrough

  • Make sure composer is installed
  • Install D7
  • drush en patternbuilder -y
  • drush en patternbuilder_importer -y
  • CD to sites/all/libraries
  • git clone https://github.com/PatternBuilder/pattern-builder-lib-php.git patternbuilder
  • cd patternbuilder && composer install
  • Create a templates and schemas folder (location is up to you)
  • Goto admin/config/content/patternbuilder set configuration to point to those folders
#schemas/foo.json#

{
  "type": "object",
  "properties": {
    “bar”: {
      "type": "string"
    }
  }
}
#templates/foo.twig#

{{bar}}
  • Run pattern builder importer drush pbi or drush pbi foo
  • Goto/Create content type
  • Manage fields
  • Add new field -> Paragraphs
  • Manage display
  • Change format to “Patternbuilder rendered item”
  • Create new content type and add foo paragraph
  • You'll have a single field bar that will be rendered directly through foo.twig