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
18
18
19
-
Pattern Lab core 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.
19
+
Pattern Lab core 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 works with the include function provided by this plugin with all PatternEngines and also with regular includes in template files with Twig PatternEngine.
20
+
21
+
Please note that global data from the `_data` directory is considered to be pattern-specific data and will overwrite data inherited from a parent pattern. If you want to override data of an included pattern you can use the `with` keyword.
20
22
21
23
22
24
### Data transform functions
@@ -59,7 +61,7 @@ It is also possible to include [pseudo-patterns](http://patternlab.io/docs/patte
59
61
60
62
```json
61
63
{
62
-
"key": "molecules-shila-card.html-variant"
64
+
"key": "molecules-shila-card-html-variant"
63
65
}
64
66
```
65
67
@@ -70,11 +72,11 @@ It is also possible to include [pseudo-patterns](http://patternlab.io/docs/patte
70
72
{
71
73
"key": {
72
74
"join()": [
73
-
"molecules-comment.html",
75
+
"molecules-comment-html",
74
76
"<div class=\"indented\">",
75
-
"molecules-comment.html",
77
+
"molecules-comment-html",
76
78
"</div>",
77
-
"molecules-comment.html"
79
+
"molecules-comment-html"
78
80
]
79
81
}
80
82
}
@@ -123,11 +125,6 @@ The value of `key` will be replaced with an [`Attribute` object](https://www.dru
123
125
The value of `key` will be replaced with an `Url` object. Note that in the example `attributes` will be replaced with an `Attribute` object before the `Url` object is created.
124
126
125
127
126
-
## Global data and includes
127
-
128
-
Please note that global data from the `_data` directory is considered to be pattern-specific data and will overwrite data inherited from a parent pattern. If you want to override data of an included pattern you can use the `with` keyword.
129
-
130
-
131
128
## More examples
132
129
133
130
Most features provided by this plugin are used in [Shila Drupal theme](https://github.com/aleksip/shila-drupal-theme).
0 commit comments