Skip to content

Commit 3bd4cb9

Browse files
committed
Fix image not being displayed on blog and blogOverview
1 parent 28eadf5 commit 3bd4cb9

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

app/models/blog_overview_page.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
class BlogOverviewPage < Obj
22
attribute :title, :string
3-
attribute :image, :reference
43
attribute :body, :widgetlist
54
attribute :child_order, :referencelist
65
end

app/models/blog_post_page.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
class BlogPostPage < Obj
22
attribute :title, :string
3+
attribute :image, :reference
34
attribute :body, :widgetlist
45
attribute :created, :date
6+
attribute :abstract, :html
57

68
default_for :created do
79
Time.zone.now

app/views/blog_overview_page/index.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<% @blog_posts.each do |blog_post| %>
2-
<h4><%= link_to(scrivito_value(blog_post.title), scrivito_path(blog_post)) %></h4>
2+
<h2><%= link_to(scrivito_value(blog_post.title), scrivito_path(blog_post)) %></h2>
3+
<%= content_tag(:p, scrivito_value(blog_post.abstract)) %>
4+
<%= scrivito_image_tag(scrivito_value(blog_post.image)) %>
35
<% end %>
46

57
<%= link_to("previous page", @previous_page) if @previous_page %>

app/views/blog_post_page/index.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
<% end %>
66

77
<%= scrivito_tag :h1, @obj, :title %>
8-
<%= scrivito_tag :div, @obj, :body %>
8+
<%= scrivito_tag(:div, @obj, :abstract) %>
99
<%= scrivito_tag(:div, @obj, :created) %>
10+
<%= scrivito_image_tag(@obj, :image) %>
11+
<%= scrivito_tag :div, @obj, :body %>

0 commit comments

Comments
 (0)