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

How to disable header image for blog posts in Quark theme

theme

Solved by pamtbaau View solution

Started by Stefan Veit 2 years ago · 4 replies · 288 views
2 years ago

Capture.PNG|431x500

Hi,
I am running Grav with default Quark theme. I added a blog page and two blog entries (see screenshot). However, no matter what I try I cannot get rid of the header/title image. It just duplicates the one image in the blog post and that looks stupid to me.

Any pointers on what I might be missing?

I have tried:

  • Frontmatter: Add "hero: none", "hero_image: false" and iterations of false, none etc.
  • Toggle the "Display Header Image" option in the "Blog Item" settings.

Any help greatly appreciated! Thank you.

2 years ago

@PeskyParrot, That's by design... See lines 1-7 of Quarks template blog-list-item.html.twig

You can prevent that behaviour, by placing the image in your Markdown below the summary size or summary separator.

Any pointers on what I might be missing?

Knowledge... 😇

2 years ago

Thank you for that - this at least removes the image in the content / summary.
But then, if I may draw on your knowledge, would you remove the one in the blog title? What is the “Display Header Image” option for?
Thanks again.

2 years ago Solution

@PeskyParrot,

But then, if I may draw on your knowledge , would you remove the one in the blog title?

Why is knowledge written using italic? 🤔

Anyway... If you take a look at lines 1-7 of template blog-list-item.html,twig, you'll see there is no logic to prevent displaying the card-image div at the top of the blog list item.

All you can do is removing the logic that creates the "card-image" <div> in Twig. But please only make changes in an inheriting theme, else you'll lose all changes when a new version of Quark arrives.

What is the “Display Header Image” option for?

Nothing? It's available since v1.0.1 (2018), but I don't see any use for it. Maybe its a copy/paste leftover...

How you can find out yourself:

  • Lookup the name of the field with title "Display Header Image" in the blueprint of the blog item (themes/quark/blueprints/item.yaml). You'll find "header_image"
  • Search in all templates the occurrence of "header_image"
  • If you don't find a reference anywhere, it is probably not being used.

Update:

  • Antimatter, the poster theme before Quark, did contain the same "header_image" and had a use for it in its templates. So, I guess it was copied into its successor Quark.
last edited 04/11/24 by pamtbaau
2 years ago

Thank you again.

Quite confusing to include options that are not being used - especially for beginners.

Anyways, thanks again for your time and help.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 197 2 months ago
Themes & Styling · by Ian, 2 months ago
3 92 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 454 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 47 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 127 3 months ago