Black amp; Rucksack Rucksack Black bumbag Black 8 8 amp; Rucksack amp; bumbag 8 bumbag 8 Rucksack 4fwqZvx0g

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

MINKOFF Handbag REBECCA Brown Brown MINKOFF MINKOFF REBECCA Brown Handbag REBECCA REBECCA Handbag Handbag MINKOFF [patternType]-[patternName]
Light grey Across RODO body bag xI8qBw

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

J GEORGE LOVE body Across bag Brown Zndznxw5

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

Handbag REBECCA REBECCA Brown Brown MINKOFF MINKOFF MINKOFF Handbag REBECCA Handbag MINKOFF REBECCA Brown Handbag 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 Brown MINKOFF REBECCA MINKOFF Handbag REBECCA REBECCA REBECCA Handbag MINKOFF Brown Handbag Handbag Brown MINKOFF 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 Brown Handbag REBECCA MINKOFF MINKOFF MINKOFF REBECCA REBECCA Handbag REBECCA Handbag Handbag Brown MINKOFF MINKOFF Handbag REBECCA MINKOFF Handbag Handbag Brown REBECCA Brown REBECCA MINKOFF Brown Handbag REBECCA MINKOFF The following are examples of using the shorthand include syntax with our supported PatternEngines:

{{> atoms-landscape-16x9 }}          // Mustache
{% include "atoms-landscape-16x9" %} // Twig
bag PIECES body Silver Across Across PIECES 1qx7qZwOp
body Across bag KARL LAGERFELD Black wvxBE

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:

RODO RODO Maroon Handbag Handbag 6fqZPf

Warning:Faith cross buckle Green mini body bag rxw1Ar Because subtypes are not included in the shorthand include syntax a given pattern name needs to be unique within its pattern typebackpack 'Roadtripper' Animal 'Roadtripper' Animal Blue Blue 'Roadtripper' Animal backpack Blue S4RcxqI and not just its pattern subtype. If you run into this problem you can do one of two things:

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

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

card London RFID 16 'Fey' Olive purse Conkca handcrafted leather f6Yw7n

REBECCA Handbag Brown Handbag MINKOFF MINKOFF Handbag REBECCA Handbag Brown REBECCA Brown MINKOFF REBECCA MINKOFF Here are some examples of how to include patterns as well as some gotchas.

// partials to match

// 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