@@ -9,12 +9,52 @@ When pattern configurations are saved, the template is downloaded locally (to mi
99
1010Rendered twigs may contain drupal tokens, which are then processed in context.
1111
12+ ## Installation
13+ Install the patternkit module as usual, and review the important variables below to determine if you would like to change the defaults.
14+
15+ Install the Twig library into /sites/all/libraries/Twig
16+ ```
17+ git clone git://github.com/twigphp/Twig.git -b 1.x /tmp/Twig
18+ mv /tmp/Twig/lib/Twig ${DRUPALDIR}/sites/all/libraries/
19+ rm -rf /tmp/Twig
20+ ```
21+
22+ The patternkit module by itself only provides the glue for other modules to present components. Define one by implementing ``` hook_patternkit_library ```
23+
24+ An example implementation follows
25+ ```
26+ /**
27+ * Implements hook_patternkit_library().
28+ */
29+ function webrh_patternkit_library() {
30+ $libraries = array();
31+
32+ $namespaces = array(
33+ 'Web RH Patterns' => 'webrh/src/library',
34+ );
35+
36+ $module_path = drupal_get_path('module', 'webrh');
37+ foreach ($namespaces as $namespace => $path) {
38+ $lib_path = $module_path . DIRECTORY_SEPARATOR . $path;
39+ $libraries[] = new PatternkitDrupalTwigLib($namespace, $lib_path);
40+ }
41+
42+ return $libraries;
43+ }
44+ ```
45+
46+ There are two different plugins currently available,
47+ * PatternkitRESTLib
48+ * PatternkitDrupalTwigLib
49+
50+ Use the former for dynamic REST based components, and the latter for locally sourced.
51+
1252## Important Variables
13- * patternkit_cache_enabled - Whether or not the metadata and render cache are enabled. (Disable during development)
14- * patternkit_pl_host - The scheme://hostname: port / of the PatternLab library host.
15- * patternkit_default_module_ttl - How long the rendered pattern should be cached.
16- * patternkit_show_errors - Whether or not to display messages on the site.
17- * patternkit_log_errors - Whether or not to log errors to php error log.
53+ * ``` patternkit_cache_enabled ``` - Whether or not the metadata and render cache are enabled. (Disable during development)
54+ * ``` patternkit_pl_host ``` - The scheme://hostname: port / of the PatternLab library host.
55+ * ``` patternkit_default_module_ttl ``` - How long the rendered pattern should be cached.
56+ * ``` patternkit_show_errors ``` - Whether or not to display messages on the site.
57+ * ``` patternkit_log_errors ``` - Whether or not to log errors to php error log.
1858
1959## TODOs
2060* https://github.com/drupal-pattern-lab/roadmap/issues/8 Solve the problem of mapping Drupal fields to pattern Variables.
0 commit comments