Disable hero image for Quark item

For some blog items, I would like to have images embedded in the post, bot NOT as a hero image. Unfortunately, if any image is with the item, a hero images is set.

Is there a way to disable this on a per-page base?

@metbril Do you mean the image displayed per item in the list of blog items? Or the image displayed at the top of a single blog item?

I presume the first…

In the template /templates/partials/blog-list-item.html.twig, there is the following code near the top:

{% set image = page.media.images|first %}
{% if image %}
<div class="card-image">
    <a href="{{ page.url }}">{{ image.cropZoom(800,400).html }}</a>
</div>
{% endif %}

If any image is in the folder of the item, it will be displayed. To prevent this you could add an extra field in the blueprint item.yaml like ‘no_header’, or abuse the existing field ‘header.header_image’ and set it to ‘disabled’. In the page’s frontmatter it will show as:

header_image: '0'

If you change the code at the top of blog-list-item.html.twig as follows, the image will not be shown only if page.header.header_image is ‘0’:

{% set image = page.media.images|first %}
{% if image and page.header.header_image != '0' %}
<div class="card-image">
    <a href="{{ page.url }}">{{ image.cropZoom(800,400).html }}</a>
</div>
{% endif %}
1 Like

I had hoped the theme had a setting to disable this; a child theme will do as well, however.

Uhh yes, these changes should be done in a child theme…

Looking at the code, I cannot imaging there is a setting for this. And I don’t understand why one would like to have a first image (alphabetically) to be shown at the top… If I want one, let me pick one, just like the hero image…

Well, you can pick one (of you have more images in the folder), but if you don’t, the theme will pick one for you. That is why I was asking…