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
Copy file name to clipboardExpand all lines: docs/pattern_builder_importer.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ It converts an library of JSON Schemas into Drupal paragraph bundles, and the JS
13
13
14
14
1. With a library of patterns created in Pattern Builder, we need a method for creating each Drupal admin interface that allow users to enter the data needed for each template.
15
15
16
-
1. As a content admin, you may want to create a customizable content type(s) which include entity references to smaller content patterns, such as field collection bundles. These bundles will be built to match the defined components from the Styleguide. This would expose the ability to both create content and control the ordering, layout, and design from within the node editing interface, and would be fully revisionable. Additionally, editors would be able reference & include existing view blocks within the field groups. Editors could then apply data attributes such as layout and theme to these view blocks or field collections.
16
+
1. As a content admin, you may want to create a customizable content type(s) which include entity references to smaller content patterns, such as field collection bundles. These bundles will be built to match the defined components from the Style guide. This would expose the ability to both create content and control the ordering, layout, and design from within the node editing interface, and would be fully revisionable. Additionally, editors would be able reference & include existing view blocks within the field groups. Editors could then apply data attributes such as layout and theme to these view blocks or field collections.
17
17
18
18
19
19
### Where
@@ -48,11 +48,11 @@ It converts an library of JSON Schemas into Drupal paragraph bundles, and the JS
48
48
49
49
1. Drush Commands
50
50
1. Imports patterns from defined library
51
-
- drush pbi : Import all schemas.
52
-
- drush pbi --all : Force the import of all schemas even if specific schemas are defined.
53
-
- drush pbi band card : Import only the "band" and "card" schemas.
54
-
- drush pbi --type=layout : Import only the schemas for the "layout" pattern type.
55
-
- drush pbi -image_box
51
+
- drush pbi : Import all schemas.
52
+
- drush pbi --all : Force the import of all schemas even if specific schemas are defined.
53
+
- drush pbi band card : Import only the "band" and "card" schemas.
54
+
- drush pbi --type=layout : Import only the schemas for the "layout" pattern type.
55
+
- drush pbi image_box
56
56
57
57
1. Remove imported patterns from Drupal
58
58
- drush pbi-remove : Nothing is removed. This safeguards against accidental commands.
@@ -361,15 +361,15 @@ This message is logged if the referenced property's schema is not creatable and
361
361
362
362
The allowed schemas references a schema that is not imported based on the pattern's status. The "inactive" status is provided by the patternbuilder module.
363
363
364
-
In Drupal, this refers to the pargraphs field's allowed bundles (schemas) which must be available on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
364
+
In Drupal, this refers to the paragraphs field's allowed bundles (schemas) which must be available on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
365
365
366
366
- - -
367
367
368
368
**WARNING: 'The paragraphs field @field_name references a schema that is not creatable due to the status "deprecated", schema: schema_old.json'**
369
369
370
370
The allowed schemas references a schema that is not creatable based on the pattern's status. The "inactive" and "deprecated" statuses are provided by the patternbuilder module.
371
371
372
-
In Drupal, this refers to the pargraphs field's allowed bundles (schemas) which must be allowed to be created on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
372
+
In Drupal, this refers to the paragraphs field's allowed bundles (schemas) which must be allowed to be created on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
The Pattern Builder Module empowers your team to prototype in a static pattern library and then import the designs and content data model into Drupal with a single drush command.
11
11
12
-
Need to update your design? No problem! Just update and QA the code in your pattern library and import those changes in seconds.
12
+
Need to update your design? No problem! Just update and QA the code in your pattern library and import those changes to Drupal in seconds.
13
13
14
14
15
15
### Why
@@ -27,28 +27,17 @@ Need to update your design? No problem! Just update and QA the code in your patt
27
27
28
28
### How
29
29
30
-
Good question! It could be:
30
+
The Pattern Builder module contains a composer.json to build the library dependencies.
31
+
Below are some options to integrate the patternbuilder module into a project.
31
32
32
-
1. Composer Module
33
-
- Add composer dependency
34
-
- Symlink assets to web/app root (or use custom install location)
- View logs: Logs are available in the server log files, search for logs with "patternbuilder". Actual location depends on the server's config for syslog.
60
+
61
+
62
+
#### Log Messages
63
+
64
+
**WARNING: 'Duplicate schemas found for "my_schema" at "file:///path/to/schemas-alternative/my_schema.json". The first schema registered will be used until this conflict has been resolved. Active schema: "file:///path/to/schemas/my_schema.json"'**
65
+
66
+
The Pattern Builder module allows multiple schema directories to be defined at "admin/config/content/patternbuilder". This message is logged when there is a schema file with the same name in multiple directories.
67
+
68
+
- Check that the schema directories are configured correctly at "admin/config/content/patternbuilder".
69
+
- Verify the schema files in the directories.
70
+
71
+
- - -
72
+
73
+
**ERROR: 'An error occurred while rendering the "pbi_my_schema" paragraph item (id:1, revision:22) on node (id:234, revision:6788): Unable to find template ".twig" (looked into: /var/www/html/path/to/schemas, /var/www/html/path/to/schemas-alternative) in "my_band.twig" at line 61.**
74
+
75
+
The error log "An error occurred while rendering ..." occurs during rendering of the field formatter typically on the node page. This error is logged for any error occurring in the Pattern Library rendering of the schema and TWIG template.
76
+
77
+
This is a silent error so that it does not stop the rendering of the rest of patterns and the Drupal page. The failed pattern will not be displayed on the page.
78
+
79
+
A common error is displayed above. This is an error when a TWIG template includes another template without specifying a file name.
0 commit comments