I want to add a team members section in my theme, I want to have one file that would contain multiple entries of members and add it to the template, Is there a way to do this by using a .yaml file or is there any other way?
Archive
You could just create a user/config/members.yaml file and in that have an array of members.
YAML
kaladan:
name: kaladan
email: kaladan@mail
image: kaladan.png
bio: simple bio
joeblow:
name: Joe Blow
email: j[email protected]
image: joe.jpg
bio: joe bio
Then you can use this in your template via:
TWIG
{% for member in config.members %}
Name: {{ member.name }}
Email: {{ member.email }}
{% endfor %}
---
Thank you. This will make my work a lot easier.
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1366 | 9 years ago | ||
| 2 | 940 | 9 years ago | ||
| 2 | 4069 | 9 years ago | ||
| 1 | 2960 | 9 years ago | ||
| 3 | 1125 | 9 years ago |