# Tag.globals.actual\_page returning null

**URL:** <https://www.ruby-forum.com/t/tag-globals-actual-page-returning-null/120322>\
**Category:** Radiant CMS\
**Created:** [November 15, 2007, 7:48pm UTC](https://www.ruby-forum.com/t/tag-globals-actual-page-returning-null/120322 "2007-11-15T19:48:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [November 15, 2007, 7:48pm UTC](https://www.ruby-forum.com/t/tag-globals-actual-page-returning-null/120322/1 "2007-11-15T19:48:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [November 15, 2007, 8:53pm UTC](https://www.ruby-forum.com/t/tag-globals-actual-page-returning-null/120322/2 "2007-11-15T20:53:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [November 15, 2007, 9:12pm UTC](https://www.ruby-forum.com/t/tag-globals-actual-page-returning-null/120322/3 "2007-11-15T21:12:47Z")

</div>

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.
