refinery / refinerycms-news

News Plugin for Refinery CMS
http://www.refinerycms.com
MIT License
121 stars 120 forks source link

body_content_title doesn't show up #116

Closed Pym closed 12 years ago

Pym commented 12 years ago

With a clean Refinery installation and only the news engine, the line below from views/refinery/news/items/show.html.erb isn't rendered in the final web page:

<% content_for :body_content_title, @item.title %>

It looks like we can't override the body_content_title of the /refinery/content_page partial unless we set the page_title someway. And since I'm new to Ruby and Rails, I've no clue how to do that.

Please have a look at the corresponding code: https://gist.github.com/c3e3de589e18044bfe48

After visiting #refinerycms, @sedrickcz told me to try this :

<%= render :partial => "refinery/content_page", :locals => { :page_title => @item.title } %>

And yes, the page_title is set in my page but the ContentPagePresenter doesn't give a sh**

ugisozols commented 12 years ago

I can't reproduce this using 2-0-stable branches... if I do:

<% content_for :body_content_title, "huh?" %>

it displays huh? as page title.

Pym commented 12 years ago

I just edited my Gemfile to use the 2-0-stable branches (which don't seem to differ from the RubyGems) and the body_content_title still doesn't appear on my page.

Do you have the h1 showing up or have you just tried to dump page_title?

ugisozols commented 12 years ago

h1 is showing up as expected: <h1 id="body_content_title">huh?</h1>

Pym commented 12 years ago

I'm curious, do you have the same result with refinerycms-search?

@bricesanchez encountered the same problem as me https://github.com/refinery/refinerycms-search/issues/23

Pym commented 12 years ago

For an unknown reason, the rails generate refinery:news task doesn't have generated the News page and that was the origin of the problem.

ugisozols commented 12 years ago

rails generate refinery:news only copies files (migrations etc.) and adds Refinery::News::Engine.load_seed (<- this is responsible for adding news page entry in db) entry in seeds.rb so you have to do rake db:migrate && rake db:seed yourself.

Pym commented 12 years ago

My bad, I thought that it was also executing those automatically.

Thanks for the explanation!