[Radiant] Access to params within extension

Daniel Sheppard daniels at pronto.com.au
Mon Jan 22 01:11:10 CST 2007


Hmmm... seems that tags ARE instance_eval'd on the page, so ignore my
last email. You're after params as interpreted by controllers. I think
those are available with @request.path_parameters


________________________________

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

	No, I get that. Here is my custom route:

	map.connect 'event-calendars/:calendar_group/:calendar/:period',
:controller => 'site', :action => 'show_page', :url => 'calendar'

	So I'm forward the control back to the Radiant Site controller. 

	My question is within the Page type which I attach to the real
Radiant page found at "/calendar" how can I cleanly access the url
params ? This is how I solved it for now, but it's ugly and inflexible:

	class EventCalendar < Page
	 ....
	  tag "calendar" do |tag|
	    path = @request.request_uri.split("/")
	    p = Hash[:calendar_group => path[2], :calendar => path[3],
:period => path[4]]
	    ...
	  end
	end

	Just hoping to find a better way. 

	Thanks,

	On Jan 21, 2007, at 11:52 PM, Daniel Sheppard wrote:


		If you've made a custom route, then that route will be
handled by a

		regular rails controller, not a page object.


	
	Loren Johnson
	loren at fn-group.com




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20070122/9dc84b55/attachment.html


More information about the Radiant mailing list