Tag.globals.actual_page returning null

Using Radiant 0.6.4 gem. The following is false because
tag.globals.actual_page is being returned NULL…

tag “if_page_is_self” do |tag|
tag.expand if tag.locals.page == tag.globals.actual_page
end

I’m using my tag like…

<r:find url=“about”>
<a href="<r:url />"<r:if_page_is_self>
class=“selected”</r:if_page_is_self>><r:breadcrumb />
</r:find>

Any ideas on why tag.globals.actual_page is returning NULL?

David,

When Daniel cleaned up cruft in the Page model, he made snippets
render on the global page, i.e. tag.globals.page. In r601, I changed
r:content to be rendered by the global page too. What this does is
maintains tag.globals.page as the currently rendering page. It’s a
pretty ingenious and subtle change – we don’t create a new context
and parser, so all rendering context is retained.

Sorry, this is a roundabout way of saying, use tag.globals.page
instead of tag.globals.actual_page.

Cheers,

Sean

Sean C. wrote:

When Daniel cleaned up cruft in the Page model, he made snippets
render on the global page, i.e. tag.globals.page. In r601, I changed
r:content to be rendered by the global page too. What this does is
maintains tag.globals.page as the currently rendering page. It’s a
pretty ingenious and subtle change – we don’t create a new context
and parser, so all rendering context is retained.

Sorry, this is a roundabout way of saying, use tag.globals.page
instead of tag.globals.actual_page.

Sean – Thanks for the quick response. The fix worked perfectly, and the
behind-the-scenes explanation is appreciated.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs