Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Chaz Chumley
@chazchumley
@brooke-heaton hope life is treating you well
I have been using Lando the challenge though is since its all containers, is that the theme layer has no idea that PHP exisits so PL fails to run. So far I have just bypassed this by running grunt or gulp that runs the PL commands on the host machine
Moritz Jaeger
@m4con
Hi @all!
Does anyone know how to change the port, the server is running on with the command "php core/console --server"? (i.e. localhost:8080 -> localhost:1234)
Erik Mogensen
@mogsie
edit: Use command line parameters, @simply-moritz
php core/console --server --port 1234
Ignore the first message I sent, I looked at one of our Dockerfiles and made an assumption. :)
Sam Turner
@digiltd
ello, anyone used patternlab with Magento (1 or 2) before?
Konrad Abe
@KADlancer

Hi everyone. I really love using the php version of pattern lab... working like this is a little bit like magic... but I've run into a little problem.

I can work locally and everything is fine but when I push my stuff to my repo and git triggers my jenkins, the console -generate command only creates half of the files/folders in public. I'm missing all public/ css, js, fonts and images and while all the index pages for all (atoms/molecules as well as atoms/buttons etc.) are created, the respective twig files are missing in public as well as the .markup-only.html files and the specific html files like 00-atoms-06-buttons-01linkbuttons.html.

Apparently all those html files are generated under /exports but I can't find the assets (css, js etc.) anywhere while they are all there when I generate locally...

Erik Mogensen
@mogsie
I think you need to run composer install somehow, to get the styleguidekit or something.
Konrad Abe
@KADlancer
in that case I would have to install and set up composer. I'm currently working with the downloaded version and everything was fine while I work locally. Just now I had a similar problem occuring locally where I added 00-atoms/00-global/01-colors.twig but neither the 00-atoms-01-global-01-colors.twig nor the 00-atoms-01-global-01-colors.markup-only.html were generated.
Erik Mogensen
@mogsie
If there's a syntax error in the twig or JSON files it sometimes fails to build, sometimes with no real explanation of why. But then again it usually detects the error and returns a nonzero exit code. hmm.
Maybe there's a .gitignore that's ignoring stuff that (usually) should not be checked in (from the downloaded version)?
Konrad Abe
@KADlancer

I checked the gitignore and compared what files were transferred to the server. apparently all checks out, works local but doesn't work on the server.

I'm currently changing my tech stack to include composer in my vagrant box and I'll run the same test with the same _patterns but an up to date version installed via composer to compare the results.

yevgeny alianov
@alianov
hi everyone, is it possible to use include() within a yml file, to include another pattern? ( a slide pattern in a slideshow pattern), I am able to use it in a json file, but not in yml. any ideas?
Drupal btw.. this is important as I would like that Drupal will do the html rendering of the slide pattern.
coreylafferty
@coreylafferty
@alianov I think something like this will work:
content:
  join():
    - include():
        pattern: layouts-grid
        with:
          content:
            join():
              - include():
                  pattern: components-card
neetumorwani
@neetumorwani
Hi Everyone - I am using patternlab with Drupal and I ve defined patternlab files namespaces for drupal to pick up file. Problem- There is nesting of files in patternlab and drupal is unable to identify the "included" twig files(shorthand patternlab syntax) in another twig files. Has anyone faced this situation and solved it before?
yevgeny alianov
@alianov
@neetumorwani, can you please paste a code example?
neetumorwani
@neetumorwani
@alianov yeah -
{% for item in items %} {% include "atoms-heading" with item only %} {% endfor %}
where "atoms-heading" is partial name for another patternlab file(kind of nesting) and this results in error at Drupal end
yevgeny alianov
@alianov
try: {% include '@atoms/heading/_heading.twig' with item %}
@neetumorwani _heading.twig stands for your atom pattern template file.
Konrad Abe
@KADlancer

Is there a way to build a patternlab overview page that lists the same content as the patternlab top bar but in expanded tabs/boxes so a concepter/designer can get a better feeling for the whole picture instead of having to navigate through the multiple multi level dropdowns or using the search?

If it doesn't exist, could someone point me in the right direction how to maybe build that myself as a plugin?

I'm using the PHP/Twig version.

Andrew Bailey
@fallenturtle
Anyone know any good guides for setting up Patternlab 2 (PHP version) with gulp? I can't find anything on Google that isn't for PL1
Andrew Bailey
@fallenturtle
Maybe I should write one if I can figure this out. Here's a question: Do I understand correctly now that PatternLab cleans out the old files when it generates and thus I don't need to use any del or clean tasks with Gulp?
jpwitkowski
@oec_jpwitkowski_twitter
Hello! I'm setting up Phase2 PatternLab/Particle 9.7.1 and am unable to get 'pattern states' to work in the styleguide... Is it even functional in this release?
Andrew Bailey
@fallenturtle
Anyone know if listItems.php works with Twig based pattern lab?
Andrew Bailey
@fallenturtle
Nevermind, figured it out
coreylafferty
@coreylafferty
@fallenturtle how'd you do it? I think we typically avoid listitems in Twig PL.
Andrew Bailey
@fallenturtle
{% for listItem in listItems.four %}
{{ listItem.title }}
{% endfor %}
the part I was missing was prefacing all the variables with listItem.
coreylafferty
@coreylafferty
Ok, thanks! I think we usually avoid it because we'd need to use an include inside the for loop, and the listitem data isn't accessible from another twig file.
Andrew Bailey
@fallenturtle
yea, I think i'm about to run into that issue
oh well :/
coreylafferty
@coreylafferty
It's not perfect, but we usually just call the same component multiples times from a YAML file for the component or the template and throw in some data similar to what you'd get from the listitem file(s). example:
/code content:
join():
- include():
    pattern: components-image-teaser
    with:
      image: https://picsum.photos/800/450?image=304
      title: "Title #1"
- include():
    pattern: components-image-teaser
    with:
      image: https://picsum.photos/800/450?image=305
      title: "Title #2
Andrew Bailey
@fallenturtle
thanks, I'll look into that... I've just been using json so far. I might also consider just jumping over the the mustache version since I'm pretty early in my project still... I went with twig initially because I've had experience with it and I wanted to use Timber and develop a WordPress theme and PL style guide in conjunction, but my lead didn't want to use Timber, so its no longer a requirement
coreylafferty
@coreylafferty
Same thing we do in YAML would work in JSON -- but yeah, listItem should work fully in the mustache version.
Tsegaselassie Tadesse
@tsega
Hey y'all! I wanted to get started with Pattern Labs, I'm a Drupal front-end developer. I wanted some pointers on how to get started, which documentation/tutorial to read and learn some best practices.
umakanth29
@umakanth29
Actually i have already installed pattern lab drupal standard edition in drupal custom theme directory and was working on untill now gave those css paths of pattern lab in drupal libraries.yml file but the problem here is when check the aggregate css and JS and save the configuration on drupal UI the styles aren't showing up
David
@davidmoret
Hello everybody. I use pattern-lab in a drupal theme. I started from this repository: https://github.com/EvanLovely/pattern-lab-starter
In the colors.md file I can read "Colors below are automatically pulled from _color-vars.scss" .. this does not work on my side. I was wondering if it was handled by pattern-lab ?
Andrew Bailey
@fallenturtle
David: By default its not but his theme is supposed to as I recall.
are you using the c- prefix with them?
yevgeny alianov
@alianov
Hi everyone, can you please advise - is there a Drupal Sub theme implementation of Pattern Lab, possibly using evanlovely/plugin-twig-namespaces. I would like to list parents theme patterns in a subtheme style guide.
including the parent patterns is not an issue, showing them in a style guide is.
Benet 'Dr' Hitchcock
@starlifterdigi_gitlab
Has anyone set up the twig version locally lately?
Moritz Jaeger
@m4con
@starlifterdigi_gitlab using it with my current project (locally and remote).
Spencer Westwood
@spencerwestwood_twitter
Does anyone have pointers for implementing language changes in components based on the drupal language selected. For example if I have a button that originally has its text body defined in a button-cta.json file and I want to have it translate to the drupal 8 language that the user has selected (say French or Italian) what's a way of implementing this within a D8 theme?
Luke Pinion
@lwpinion
I've switched to PL PHP for the time being, but I'm having trouble getting my localhost running. The documentation indicates that "Pattern Lab comes with its own built-in web server," so I should be able to just serve it with php core/console --server and then pull up http://localhost:8080/ in my browser, right? However, localhost is coming up as connection refused. Is there any configuration that needs to be done with Pattern Lab or PHP to get this functioning?
Shibin Das
@d34dman
Hi guys, do you have any good guide / workflow to integrate forms in Drupal?
Shibin Das
@d34dman
@lwpinion try php core/console --server --host=0.0.0.0