Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Set header image on antimatter theme

Started by Muut Archive 12 years ago · 2 replies · 862 views
12 years ago

Can someone explain me how to add a header image to the antimatter theme. Like it's done in all of the preview images.

12 years ago

I smiply used HTML:

<div align="center">
<img src="path-to-your-image.jpg"></img>
</div>

Antimatter automatically resizes it to fit on any screen-size.

12 years ago

If you download the blog-skeleton package you can get a working example of the demo: http://demo.getgrav.org/blog-skeleton/ You can see how the header image for each post is pulled out automatically and added to the top of the post by looking at the partials/blog_item.html.twig file. Specifically this bit:

TWIG
{% if big_header %}
    {{ page.media.images|first.cropResize(900,600).html }}
{% else %}
    {{ page.media.images|first.cropZoom(900,300).html }}
{% endif %}

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 672 1 week ago
Archive · by Deleted User, 9 years ago
0 3042 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5336 9 years ago
Archive · by Muut Archive, 9 years ago
1 4134 9 years ago