Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Variables between Twig files and MD?

Started by Muut Archive 11 years ago · 1 replies · 355 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 2598 9 years ago
Archive · by Muut Archive, 9 years ago
2 1708 9 years ago
Archive · by Muut Archive, 9 years ago
2 5001 9 years ago
Archive · by Muut Archive, 9 years ago
1 3833 9 years ago
Archive · by Muut Archive, 9 years ago
3 1815 9 years ago