Skip to content

Commit 3b228ce

Browse files
committed
updated content type setup steps and methods to use
1 parent 4ac764b commit 3b228ce

File tree

1 file changed

+32
-17
lines changed

1 file changed

+32
-17
lines changed

docs/using_pattern_builder.md

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,43 @@ title: Using Pattern Builder
44

55
## Various Scenarios of using pattern builder module
66

7+
### Add a Pattern Field to a Content Type
8+
1. Create a new content type or use an existing one.
9+
1. Add a paragraphs field with patterns enabled.
10+
1. Widget: "Embedded Patterns" or "Embedded Patterns with Previewer" (requires patternbuilder_previewer module).
11+
1. Limit the pattern selection by type ("Pattern", "Components"). These need to be defined in hook_patternbuilder_pattern_types().
12+
1. Any non-pattern paragraph needs to be explicitly selected in the list of "Allowed paragraph bundles"
13+
1. Display Formatter: "Patternbuilder rendered items"
14+
1. Select display mode used to render the embed paragraphs. Defaults to "Full". For Patterns, the formatted values of the paragraph field is sent to the TWIG templates for display.
15+
1. Create content with Patterns!
16+
717
### Choose a method
818

919
1. The whole kit AND kaboodle! (recommended)  Use pattern builder importer to pull in your patterns and schemas from your component library
10-
1. Example: our FTS content type
11-
2. Create a new content type with basic Drupal fields like title, taxonomy terms, etc
12-
3. Add patterns to your content type.
13-
1. For example, our FTS content type has one hard-coded hero pattern, and every other pattern is optional
14-
1. Field_pattern_components
15-
1. Allowed paragraph bundle types: patterns
16-
17-
4. Utilizes style module to remove existing CSS
20+
1. Build a content type with a Pattern field (see above).
21+
1. Configure the directories for the JSON schemas and TWIG templates at "admin/config/content/patternbuilder"
22+
1. Enable the patternbuilder_importer module.
23+
1. Import the Pattern Schemas to Paragraph bundles:
24+
1. From the command line, run "drush pbi".
25+
1. (TODO) From the UI: Pending development.
1826

1927
2. Hybrid:  Map existing drupal fields to WebRH templates
20-
1. Example: Our Country page content type Redhat_www_type_country_module
21-
2. Allows for developers to map data (even from external sources) to the json/twig data.
22-
3. Good for existing content types
23-
4. Not good for complex field setups since hand mapping takes time and is error prone.
24-
25-
3. Basic Approach: No component library
26-
1. Example:
27-
2. Install module
28-
3. Build out patterns and templates in paragraphs?
28+
1. Allows for developers to map data (even from external sources) to the json/twig data.
29+
1. Good for existing content types.
30+
1. Not good for complex field setups since hand mapping takes time and is error prone.
31+
1. How:
32+
1. Override the node view of a given content type.
33+
1. Use the existing Drupal fields to build the render object using the PatternBuilder Library.
34+
1. Set the node view content as the rendered object.
35+
36+
3. (TODO) Component library only, No importer
37+
1. Build a content type with a Pattern field (see above).
38+
1. Configure the directories for the JSON schemas and TWIG templates at "admin/config/content/patternbuilder"
39+
1. Create a paragraph bundle.
40+
1. (TODO: Pending development) Associate the paragraph bundle with a JSON Schema.
41+
1. Add a field to the paragraph bundle.
42+
1. Configure the section "Pattern Builder".
43+
1. Required: Set the "Property name"
2944

3045
**
3146

0 commit comments

Comments
 (0)