I'm pretty new to Pattern Lab, but I feel like if this isn't a feature, it should be.
Essentially, I want to model Pattern Labs after a real site. In most (or many) real sites it's common to use a templating engine. This is true of any mainstream technology I've used (rails, django, ASP.Net, or node with handlebars) to manage the view layer. I'll use handlebars in this example because it most closely mirrors the Pattern Lab mustache syntax.
One of the big powers of templating engines is building a base layout, which may include <html>
, <head>
, <meta>
, <body>
, {{> header }}
, and {{> footer }}
. Then, you have blocks of dynamic content like {{{ body }}}
or {{ title }}
.
Pattern Lab does a really good job at taking care of the dynamic {{ title }}
variable using _data.json
, page specific json, or parameters. However, in order to make the whole content of the body dynamic you'd have to write everything in the json file, or pass it via pattern parameters. But this would limit your content because you can't pass other partials as parameters or store them in json.
Another option could be to create a bunch of pseudo patterns for example:
<div class="main-container">
{{> organisms-header }}
<div class="page-content">
{{# first }}
{{> organisms-first-page }}
{{/ first }}
{{# second }}
{{> organisms-second-page }}
{{/ second }}
{{# third }}
{{> organisms-third-page }}
{{/ third }}
</div>
{{> organisms-footer }}
</div>
But then you'd have to nest every page that you wanted to use.
Hopefully this helps and is relevant. Hopefully I'm just missing something super blatant :)