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

How to show list in templates

Started by Muut Archive 10 years ago · 2 replies · 320 views
10 years ago

simple enough, can't seem to find anything in the documentation... I am using the list blueprint and I can't figure out how to show it...if I just put {{ page.content }} I get the default content but not the stuff entered in the custom blueprint I made

https://learn.getgrav.org/forms/blueprints/fields-available#the-list-field

the example here doesn't show how the theme code should look and I can't figure it out

10 years ago

Example code from Antimatter theme modular/showcase.html.twig:

TWIG
    {% for button in page.header.buttons %}
        <a class="button{% if button.primary %} primary{% endif %}" href="{{ button.url }}">{{ button.text }}</a>
    {% endfor %}

Hope this is what you are looking for

10 years ago

Yes, {{page.content}} simply outputs the markdown of the page. If you have a structured content in the page header, you need to tell Grav how to display it in your page Twig template.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1369 9 years ago
Archive · by Muut Archive, 9 years ago
2 942 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago