File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,20 @@ protected function generatePatterns($options = array()) {
261
261
// modify the pattern mark-up
262
262
$ markup = $ patternStoreData ["code " ];
263
263
$ markupFull = $ patternStoreData ["header " ].$ markup .$ patternStoreData ["footer " ];
264
+
265
+
266
+ /** If the base template for a JSON / Yaml file (or psuedo pattern variation) lives in a different folder,
267
+ * use the `original` pattern's template instead.
268
+ * Fixes https://github.com/drupal-pattern-lab/patternlab-php-core/issues/22
269
+ */
270
+ if (!file_exists ($ patternSourceDir ."/ " .$ pathName .". " .$ patternExtension )){
271
+ $ originalPatternPathName = PatternData::getOption ($ patternStoreData ["original " ])["pathName " ];
272
+ if (file_exists ($ patternSourceDir ."/ " .$ originalPatternPathName .". " .$ patternExtension )){
273
+ $ pathName = $ originalPatternPathName ;
274
+ }
275
+ }
276
+
277
+
264
278
$ markupEngine = file_get_contents ($ patternSourceDir ."/ " .$ pathName .". " .$ patternExtension );
265
279
266
280
// if the pattern directory doesn't exist create it
You can’t perform that action at this time.
0 commit comments