Article header
Description
Title, publish date and optional hero image at the top of an article.
Pass page to fill the header from a Wagtail page: its title, first
published date and lead image (hero, with the image's title as alt
text). Any param passed explicitly wins, so date=None hides the date.
Without a page, title is required.
The title uses --jc-text-display (32px on phones up to 48px on wide
screens) so it always outranks the h2 section headings in the body.
Usage
From a page
{% article_header page=page %} fills the title, date and hero from the page; pass date=None to hide the date (projects).
{% article_header page=page %}
All parameters
Every param passed explicitly, with no page.
{% article_header
"Converting Django models and Wagtail pages"
date=2025-01-10
hero_url="https://picsum.photos/seed/jafacakes/1080/720"
hero_alt="Abstract placeholder image"
%}
Qualified tag usage
{% ui__article_header page=page %}
Parameters
| Name | Type | Requirement | Default | Choices | Description |
|---|---|---|---|---|---|
title
|
str
|
Optional | — | — | Article title. |
page
|
Page
|
Optional | — | — | Page to fill the header from. |
date
|
date | datetime
|
Optional | — | — | Publish date. |
hero_url
|
str
|
Optional | — | — | Hero image URL. |
hero_alt
|
str
|
Optional |
|
— | Alt text for the hero image. |
Select variant preset
Background colour
Viewport width
Zoom level
{% article_header page=page %}
<header class="article-header ">
<h1 class="article-header__title">Converting Django models and Wagtail pages</h1>
<p class="article-header__meta"><time class="post-date " datetime="2025-01-10">10 Jan 2025</time>
</p>
<img class="article-header__hero"
src="https://picsum.photos/seed/jafacakes/1080/720"
alt="Abstract placeholder image">
</header>