Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Variables between Twig files and MD?

Started by Muut Archive 11 years ago · 1 replies · 241 views
11 years ago

I've got this chunk of code at the Twig file

TWIG
{% for feature in page.header.features %} 
 {% if feature.teste %}
            <h1>{{feature.teste}}</h1>
{% endif %}
{% endfor %}

Then at .MD file I've got this

TXT
features:
- teste: aeasd

Isn't suposed to output <h1> aeasd </h1>?

I guess I need to register this as a variable or smth like that but I've seen anywhere to do that.

Ty for you attetion

11 years ago

Your code works when I try it. Are you sure the right twig file is being used?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1330 9 years ago
Archive · by Muut Archive, 9 years ago
2 922 9 years ago
Archive · by Muut Archive, 9 years ago
2 4051 9 years ago
Archive · by Muut Archive, 9 years ago
1 2930 9 years ago
Archive · by Muut Archive, 9 years ago
3 1108 9 years ago