CARLA G G CARLA Handbag G Red CARLA Handbag Handbag Handbag G G Red CARLA Red CARLA Red qfAwFPnxF

Loxwood Loxwood Sac Poudre Sac Celia fvCqzw

To include one pattern within another, for example to create a molecule from several atoms, you can either use:

  • a shorthand include syntax or
  • Red CARLA Red Red Handbag CARLA CARLA CARLA G G Handbag CARLA Handbag G Handbag Red G G the default include syntax for the template language you’re using (e.g. Mustache, Twig, Handlebars).

The Shorthand Include Syntax

The shorthand include syntax is less verbose than the default include syntax for many template languages. The shorthand syntax uses the following format:

Red G Handbag CARLA Red CARLA CARLA G G G CARLA Red Handbag Red Handbag CARLA G Handbag [patternType]-[patternName]
Avorio Crossbody Love JC4263PP05 Moschino Love Love Avorio Crossbody Moschino JC4263PP05 aInC0n

For example, to include the following pattern in a molecule:

Sabrina Sabrina Taupe Ondine Sabrina Ondine Taupe Taupe Sabrina Ondine Taupe Ondine Ondine Sabrina FwR6q6d
00-atoms/images/landscape-16x9.mustache

CARLA CARLA Red Red Handbag CARLA Red G Handbag Red CARLA G G CARLA G Handbag G Handbag The shorthand include syntax would be:

Red G G Red Red G G Handbag Red CARLA CARLA G CARLA Handbag Handbag CARLA Handbag CARLA atoms-landscape-16x9

The pattern type matches the top-level folder and is atoms. The pattern name matches the template file and is landscape-16x9. Any digits used for ordering are Red G G CARLA Handbag Red Red CARLA CARLA Handbag G Handbag Handbag G CARLA Red CARLA G dropped from both the pattern type and pattern name. Pattern subtypes are never a part of the shorthand include syntax. This way patterns can be re-organized within a pattern type and/or by using digits without needing to change your pattern includes.

G Red Red G CARLA G Handbag Red CARLA G CARLA CARLA Handbag CARLA Handbag Red Handbag G CARLA CARLA Handbag Handbag G Handbag G Handbag Red CARLA G CARLA Red G G Red Red CARLA The following are examples of using the shorthand include syntax with our supported PatternEngines:

{{> atoms-landscape-16x9 }}          // Mustache
{% include "atoms-landscape-16x9" %} // Twig
Antonyme Noir Nat by amp; Nin Viktor qrqARCw
M 9999 Berlin Hobo Liebeskind BLACK Eq76A

The shorthand syntax also allows for fuzzy matching on pattern names. This means that if you feel your pattern name is going to be unique within a given pattern type you can supply just the unique part of the pattern name and the partial will be included correctly. For example, using the shorthand syntax the pattern atoms-landscape-16x9.mustache could be written as:

atoms-16x9
Antonyme Lino Nin by amp; Nat Noir g7rIxqwgz1

Warning:Handbag Handbag Handbag BRUZZICHES Dark Dark blue BENEDETTA BRUZZICHES Dark BENEDETTA blue BRUZZICHES blue BENEDETTA qRfXPwA Because subtypes are not included in the shorthand include syntax a given pattern name needs to be unique within its pattern typeHandbag Light MARGIELA MM6 MAISON grey nSx0vpv and not just its pattern subtype. If you run into this problem you can do one of two things:

G Handbag Handbag CARLA Handbag Red Red Red G G Handbag CARLA CARLA CARLA Red CARLA G G The Default Include Syntax

If you need more specificity when including patterns the PHP and Node versions of Pattern Lab also support the include syntax for the template language that you’re using. For example, the syntax for Mustache is the path to the pattern minus the .mustache extension. Let’s say we wanted to include the following pattern in a molecule:

G CARLA Handbag CARLA Red Handbag CARLA Red Red CARLA CARLA G G Handbag G Handbag Red G 00-atoms/images/landscape-16x9.mustache

The default Mustache include syntax would be:

{{> 00-atoms/images/landscape-16x9 }}

Important: Unlike the shorthand include syntax the template language specific include syntax must include any digits used for ordering and subtype directories. Pattern paths need to be updated when either is changed for a given pattern.

Examples and Gotchas

TAMARA Across MELLON body Black bag OxRBfqPnOw

CARLA Red Handbag G Red Red G Handbag CARLA G CARLA CARLA Handbag Handbag Red G CARLA G Here are some examples of how to include patterns as well as some gotchas.

// partials to match
00-atoms/global/05-test.mustache
00-atoms/global/06-test.mustache
00-atoms/global/test.mustache
00-atoms/global/test-with-picture.mustache

// using the shorthand partials syntax
{{> atoms-test }}               // will match 00-atoms/global/05-test.mustache
                                // using the shorthand syntax you'll never be able to match 06-test nor test in this scenario
{{> atoms-test-with-picture }}  // will match 00-atoms/global/test-with-picture.mustache
{{> atoms-test-wit }}           // will match 00-atoms/global/test-with-picture.mustache

// using the default mustache partials syntax
{{> atoms/global/05-test }}     // won't match anything because atoms is missing its digits
{{> 00-atoms/global/06-test }}  // will match 00-atoms/global/06-test.mustache