Skip to content

Commit

Permalink
Add three column example of card blocks to landing page
Browse files Browse the repository at this point in the history
The homepage design shows a three column area on desktop, each containing a
card element. This PR adds these elements to the yaml file so that card blocks
can be previewed in a 3 column context.

Thge columns use the previously created `grid-container` rather than the
standard row/columns because we need the images in the cards to line up
regardless of how much content precedes them in the card. This can only be
achieved using flexbox or grid when the cards are all in the same container.

It's not possible to align the images in the cards if each card remains in
a separate column.
  • Loading branch information
matthillco committed Oct 14, 2024
1 parent f15d1e3 commit 282dd0b
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions lib/data/landing_page_content_items/landing_page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@ blocks:
- type: big_number
number: £43
label: Cost of a cup of coffee in Covent Garden
- type: grid_container
blocks:
- type: card
image:
alt: "Placeholder alt text"
source: "landing_page/placeholder/chart.png"
card_content:
blocks:
- type: govspeak
content: <h2><a href="http://gov.uk">Title 1 govspeak title goes here</a></h2>
- type: card
image:
alt: "Placeholder alt text"
source: "landing_page/placeholder/chart.png"
card_content:
blocks:
- type: govspeak
content: <h2><a href="http://gov.uk">Title 2 govspeak title goes here</a></h2>
- type: card
image:
alt: "Placeholder alt text"
source: "landing_page/placeholder/chart.png"
card_content:
blocks:
- type: govspeak
content: <h2><a href="http://gov.uk">Title 3 govspeak title</a></h2>
- type: two_column_layout
theme: one_third_two_thirds
blocks:
Expand All @@ -89,15 +115,12 @@ blocks:
card_content:
blocks:
- type: govspeak
content: |
<h2><a href="http://somewhere.com">Priority 1 govspeak title goes here</a></h2>
<p>Priority content 1, Nunc vulputate libero et velit interdum, ac aliquet odio mattis class. Yorem ipsum dolor sit amet.</p>
content: <h2><a href="http://gov.uk">Title 1 govspeak title goes here</a></h2>
- type: card
image:
alt: "Placeholder alt text"
source: "landing_page/placeholder/chart.png"
card_content:
blocks:
- type: govspeak
content: |
<h2>Priority 2 govspeak title goes here</h2>
content: <h2><a href="http://gov.uk">Title 2 govspeak title goes here</a></h2>

0 comments on commit 282dd0b

Please sign in to comment.