1

I'm having some trouble with Pattern Lab 3 plus Twig.

Following the instructions at https://patternlab.io/docs/installation.html:

  1. I install with: npm create pattern-lab.

  2. I choose Twig (PHP) as the templating language.

  3. I choose Twig (PHP) demo patterns (full demo website and patterns) as the the initial patterns

I do see the note The PHP version of Pattern Lab is being deprecated in favor of a new unified Pattern Lab core. The PHP docs for this topic can be viewed here.. Clicking on the link just takes me to installtion page for PHP edition of PL v.2. Not helpful. So I press on to https://patternlab.io/docs/generating-pattern-lab.html.

Next I'm supposed to run php core/console --watch. There is no core sub-directory. Things are not looking promising.

I remove my PL installation and try again with handlebars templating. With one exception, all is good. The exception: I wanted twig templates.

Ideas?

user3250335
  • 457
  • 2
  • 4
  • 13

1 Answers1

3

Indeed, the PatternLab website you saw around the time you posted this still reflected the 2.x/3.x days. Work is being done to get the legacy out and the current state in.

Last month, I contributed to this package: @pattern-lab/engine-twig. This engine is a pure Javascript based twig engine which prevents the need for PHP. It uses the Twing library under the hood (since v5.8.0). There are still things to iron out, but I welcome you to try it. Please file bugs here:

https://github.com/pattern-lab/patternlab-node/issues

Ringo De Smet
  • 448
  • 3
  • 13