Skip to content

Commit

Permalink
Merge pull request #4274 from alphagov/optional-right-columns
Browse files Browse the repository at this point in the history
Make the second column optional in two column layouts
  • Loading branch information
richardTowers authored Oct 18, 2024
2 parents b076720 + 6def00f commit 544f126
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/views/landing_page/blocks/_two_column_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<div class="<%= column_class_for_assymetric_columns(block.total_columns, block.left_column_size) %>">
<%= render_block(block.left) %>
</div>
<div class="<%= column_class_for_assymetric_columns(block.total_columns, block.right_column_size) %>">
<%= render_block(block.right) %>
</div>
<% if block.right.present? %>
<div class="<%= column_class_for_assymetric_columns(block.total_columns, block.right_column_size) %>">
<%= render_block(block.right) %>
</div>
<% end %>
</div>
5 changes: 5 additions & 0 deletions lib/data/landing_page_content_items/landing_page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ blocks:
content: Here's the content for item two
- type: govspeak
content: <p>Here's some more content!</p>
- type: two_column_layout
theme: two_thirds_one_third
blocks:
- type: govspeak
content: <p>Look ma! No right column!</p>
- type: two_column_layout
theme: two_thirds_one_third
blocks:
Expand Down

0 comments on commit 544f126

Please sign in to comment.