[Radiant] Access to params within extension

Daniel Sheppard daniels at pronto.com.au
Mon Jan 22 01:06:38 CST 2007


The @request object is made available to a Page, but the tags are not
evaluated within the context of a page. If you have a method on your
page such as:

class MyPage < Page
  def monkeys
    @request.params[:monkeys]
  end
end

Then you could reference that from your tag:

  tag 'monkeys' do |tag|
    tag.locals.page.monkeys
  end
 


________________________________

	From: radiant-bounces at lists.radiantcms.org
[mailto:radiant-bounces at lists.radiantcms.org] On Behalf Of Loren Johnson
	Sent: Monday, 22 January 2007 5:33 PM
	To: radiant at lists.radiantcms.org
	Subject: [Radiant] Access to params within extension
	
	

	Can someone give me a leg up? I'm finding it difficult to find
the request.params array anywhere within the Page context. I have setup
a custom route as part of my extension (not for the admin area, but for
the main site) and in that route I have mapped some custom params I
really want to access. 

	Any ideas... I tried tag.local.parms[], tag.page.param[],
@request.param[], etc.

	Looking through the models/page.rb and taggable I don't see any
place I'd get this from, but I'm hoping I'm missing something.

	Thanks,

	Loren Johnson 
		loren at fn-group.com


	




More information about the Radiant mailing list