Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

equivalent to pattern parameters in twig version? #22

Open
simonerlandsen opened this issue Sep 29, 2016 · 2 comments
Open

equivalent to pattern parameters in twig version? #22

simonerlandsen opened this issue Sep 29, 2016 · 2 comments

Comments

@simonerlandsen
Copy link

simonerlandsen commented Sep 29, 2016

Can anyone tell me what the equivalent twig syntax/functionality would be for pattern parameters from the mustache version?

http://patternlab.io/docs/pattern-parameters.html

I have been doing a little bit of digging in the twig docs, but for now can't seem to find the a good way to pass variables from say a molecule to a referenced atom.

@simonerlandsen
Copy link
Author

Update: found the (quite obvious) place in the twig docs:
http://twig.sensiolabs.org/doc/tags/include.html

@KatieMFritz
Copy link

@simonerlandsen This isn't working for me. Did you get it working?

My code:

{# primary-nav.twig #}

{% set nav_class = "navbar-nav" %}
...
  <ul class="{{ nav_class }}">
{#  header.twig #}

{% include "molecules-primary-nav" with { 'nav_class': 'navbar' } %}

The value of nav_class in header.twig after compiling is still "navbar-nav".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants