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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Repeating sections at one page

first-time

Started by Julia Schmolmüller 7 years ago · 5 replies · 799 views
7 years ago

Hi guys,
I am totally new at working with GRAV. I have problems to build the team side of my website. Basically it is a repeating content for each team member with different content inside. But the layout is the same. And I am not sure, if the modules functionality is the right way to do that. I just want at the team side some fields in the Backend to fill out for each member. Isn't there some functionality like in WordPress to solve this? Thank's for your help!

7 years ago

Hi Julie,

You need the "list" field for that. Works just like the acf repeater from wordpress. Of course you have to add the parameters to your blueprint in your custom theme to make it work.

7 years ago

Thanks for your reply. It is exactly the thing I need. But I can't make it work, I guess I miss something. In my theme in the blueprints folder I made a file named team.yaml with the fields inside. Then I made inside the templates directory the team.html.twig template for the team.md file. Inside the twig file I have something like:
{% for person in page.header.team %}
{{feature.text}}
{{feature.url}}
{{% endfor {% }

I can't find it in the documentation, maybe you can help me with that.
Thanks!

7 years ago

I’d need to see your blueprint but inside the for loop you need to use person.

TWIG
{% for person in page.header.team %}
{{person.text}}
{{person.url}}
{{% endfor {% }
👍 1
7 years ago

Hi Julie,

What tradedemon says is correct. Also i would recommend to enable the debug bar. With it you can dump variables and show them inside the debug bar. That way you can inspect how the data is structured.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 222 2 months ago
Themes & Styling · by Ian, 2 months ago
3 118 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 481 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 72 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 132 3 months ago