You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Pattern-specific data file support for included patterns
15
18
16
-
Pattern Lab currently only supports global data files and a pattern-specific data file for the main pattern. This plugin adds pattern-specific data file support for included patterns. This feature only works with Twig PatternEngine.
19
+
Pattern Lab currently only supports global data files and a pattern-specific data file for the main pattern. This plugin adds pattern-specific data file support for included patterns.
17
20
18
21
19
22
### Data transform functions
20
23
21
-
Currently the plugin provides 3 transform functions for the data read by Pattern Lab. The examples provided are in JSON but Pattern Lab supports YAML too! These functions should work with both Twig and Mustache PatternEngines.
24
+
Currently the plugin provides 3 transform functions for the data read by Pattern Lab. The examples provided are in JSON but Pattern Lab supports YAML too!
22
25
23
26
24
27
#### Include pattern files
@@ -87,6 +90,11 @@ The value of `key` will be replaced with the joined strings. Note that in the ex
87
90
The value of `key` will be replaced with an [Attribute object](https://www.drupal.org/node/2513632).
88
91
89
92
93
+
## Global data and includes
94
+
95
+
If you are using global data from the `_data` directory and includes (in data files or Twig templates) please note that 1) pattern-specific data overwrites data from parent patterns by default and that 2) global data for an included pattern is considered to be pattern-specific data. If you want to override pattern-specific data of an included pattern you can do that by using the `with` keyword.
96
+
97
+
90
98
## More examples
91
99
92
100
All features provided by this plugin are used extensively in [Shila Drupal Theme StarterKit](https://github.com/aleksip/starterkit-shila-drupal-theme).
0 commit comments