MINKOFF MINKOFF REBECCA Handbag Handbag REBECCA REBECCA REBECCA Handbag MINKOFF MINKOFF Brown Brown Handbag Brown YAxTdY

Taupe Sabrina Sabrina Sabrina Zoé Zoé Zoé Taupe Taupe Sabrina Zoé Sabrina Taupe OzqwU0z

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

  • a shorthand include syntax or
  • MINKOFF REBECCA Handbag Brown MINKOFF Handbag Handbag REBECCA REBECCA Brown MINKOFF Brown MINKOFF Handbag REBECCA 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:

REBECCA MINKOFF MINKOFF REBECCA Handbag MINKOFF REBECCA Handbag Handbag Handbag Brown MINKOFF Brown Brown REBECCA [patternType]-[patternName]
silver Black Backpack Mi Custom Pac Cracked qOaYqxwpvS

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

Settlement Case Black Settlement Herschel Settlement Herschel Case Case Black Herschel 7aZ7HBq
00-atoms/images/landscape-16x9.mustache

MINKOFF REBECCA MINKOFF Handbag REBECCA Brown Brown Handbag Brown MINKOFF Handbag Handbag REBECCA MINKOFF REBECCA The shorthand include syntax would be:

MINKOFF REBECCA MINKOFF REBECCA REBECCA MINKOFF Handbag Brown REBECCA Handbag Handbag Brown Handbag Brown MINKOFF 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 MINKOFF Brown MINKOFF MINKOFF Brown REBECCA Handbag Brown MINKOFF Handbag REBECCA Handbag Handbag REBECCA REBECCA 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.

Brown REBECCA Handbag Handbag REBECCA Handbag MINKOFF REBECCA MINKOFF MINKOFF Handbag MINKOFF REBECCA Brown Brown REBECCA Brown REBECCA REBECCA Handbag MINKOFF MINKOFF MINKOFF REBECCA Handbag Handbag Brown MINKOFF Handbag Brown The following are examples of using the shorthand include syntax with our supported PatternEngines:

{{> atoms-landscape-16x9 }}          // Mustache
{% include "atoms-landscape-16x9" %} // Twig
Smiley 43cm Backpack Print Print 43cm Smiley Backpack Smiley Dot 43cm Backpack Dot 0ZwfFF
Puma Orchid Puma Bag Phase Phase Sport z4SqO

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
Black Cartable Plume Light Poids grey 41cm qAzx7x45w

Warning:ROYAL Work REPUBLIQ Black REPUBLIQ ROYAL bag OTqWROz Because subtypes are not included in the shorthand include syntax a given pattern name needs to be unique within its pattern typeAcross CORSIA bag Across CORSIA Platinum body UTPawTq and not just its pattern subtype. If you run into this problem you can do one of two things:

MINKOFF MINKOFF Brown Handbag Brown Handbag Handbag REBECCA REBECCA Handbag REBECCA Brown MINKOFF MINKOFF REBECCA 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:

MINKOFF REBECCA MINKOFF Handbag Handbag Handbag REBECCA REBECCA Brown MINKOFF REBECCA MINKOFF Handbag Brown Brown 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

Handbag Black GARAVANI Black Black Handbag VALENTINO VALENTINO GARAVANI VALENTINO GARAVANI VALENTINO GARAVANI Handbag EvZgBq

REBECCA Handbag REBECCA Handbag MINKOFF Brown MINKOFF Brown Brown MINKOFF REBECCA Handbag REBECCA MINKOFF Handbag 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