Hi, I’m all new to this Twig thing. I’m trying to modify the features module to some sort of contact showcase. How would I go about, lining everything up, allow multiple rows of texts and swap out the icons for an user avatar instead? And how do I change the background color to the “text.html.twig” color instead? (Grayish background.)
I’ve tried playing around with the code for quite some while, but I just keep getting errors.
Twig is just a way to render the HTML. The content is determined by the page.
The appearance of the HTML in the browser is determined by the CSS of the theme.
So I suggest breaking down the problems into
1 - Have the page generate the HTML you want
2 - Style that HTML with CSS
You can see it checks in the page header for the features definition. That’s where it checks for the icon, and the rest of the content.
It looks for a FontAwesome icon, so that’s not working if you want to add an user avatar. You’d better copy this twig, rename it as contacts.html.twig and add your own HTML.
When starting out, it helps writing the HTML directly in the twig, then looking at a way to integrate it in the page header, so the content can be dynamic instead of hard-wired in the twig.
However, I’m still stuck with the problem how to add multiple pictures/contacts next to this current, in a fairly easy way. This picture, I added it thru the admin panel, might be the wrong way to do it.
Is the .md file even necessary? Tho it would be nice to have to quick edit names, emails and other variables. But can’t figure out how to do that. I’m probably way overthinking this…
and iterate on page.header.people in your Twig file. You can check the examples that are provided in the Skeletons, which are downloadable full Grav sites you can inspect to find out how they build the content.