Skip to content

Commit feaf3da

Browse files
committed
fall back to card-headers on content#show headers
1 parent ac96a00 commit feaf3da

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app/views/content/display/_image_card_header.html.erb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
preview_image = get_preview_image(regular_images, basil_images)
1717
combined_images = preview_image.present? ? [preview_image] : []
1818

19-
# If we have no images, try to add a default image
20-
if combined_images.empty? && @content.respond_to?(:default_image)
21-
default_image = @content.default_image
22-
if default_image.present?
19+
# If we have no images, add the card-header fallback image
20+
if combined_images.empty?
21+
card_header_path = @content.header_asset_for(@content.class.name)
22+
if card_header_path.present?
2323
combined_images << {
24-
type: 'default',
25-
data: default_image
24+
type: 'card_header',
25+
data: card_header_path
2626
}
2727
end
2828
end
@@ -42,8 +42,8 @@
4242
<% else %>
4343
<%= image_tag asset_path("missing-image.jpg") %>
4444
<% end %>
45-
<% elsif image_type == 'default' && image_data.is_a?(String) %>
46-
<img src="<%= image_data %>">
45+
<% elsif image_type == 'card_header' && image_data.is_a?(String) %>
46+
<%= image_tag image_data %>
4747
<% end %>
4848
<div class="caption bordered-text center">
4949
<h3>

0 commit comments

Comments
 (0)