capturing helper not capturing

3 views
Skip to first unread message

tenable

unread,
Dec 26, 2009, 3:26:09 PM12/26/09
to nanoc
My site has 2 columns and I'm trying to capture content from inside an
item page and then call it from the second column div inside my
layout. This is so that I don't have layout divs (the column divs) in
my items.

Code in my lib folder:

include Nanoc3::Helpers::Capturing

Code in my item:

<% content_for :column do %>
<p>This is content for the second column.</p>
<% end %>

Code in my layout:

<div id="column2">
<%= render "navigation/#{@item[:section]}" %>
<%= @item[:content_for_column] %>
</div>

Nothing is "captured" and the paragraph just shows up like regular
item content in <%= yield %>.


Denis Defreyne

unread,
Dec 27, 2009, 5:07:57 AM12/27/09
to na...@googlegroups.com
On 26 Dec 2009, at 21:26, tenable wrote:

> My site has 2 columns and I'm trying to capture content from inside an
> item page and then call it from the second column div inside my
> layout. This is so that I don't have layout divs (the column divs) in
> my items.
>

> [..]


>
> Nothing is "captured" and the paragraph just shows up like regular
> item content in <%= yield %>.

Hi,

This should work… I’ve tested it with a blank nanoc site and the result is as expected. Are you sure that the item is filtered with ERB?

Regards,

Denis

--
Denis Defreyne
denis.d...@stoneship.org

tenable

unread,
Dec 27, 2009, 11:13:17 AM12/27/09
to nanoc
> Are you sure that the item is filtered with ERB?

wow... please, shoot me now... :P

Denis Defreyne

unread,
Dec 28, 2009, 6:44:35 AM12/28/09
to na...@googlegroups.com
On 27 Dec 2009, at 17:13, tenable wrote:

>> Are you sure that the item is filtered with ERB?
>
> wow... please, shoot me now... :P

KABLAM!

--
Denis Defreyne
denis.d...@stoneship.org

Reply all
Reply to author
Forward
0 new messages