# GET params through Radiant page?

**URL:** <https://www.ruby-forum.com/t/get-params-through-radiant-page/75699>\
**Category:** Radiant CMS\
**Created:** [November 12, 2006, 2:25pm UTC](https://www.ruby-forum.com/t/get-params-through-radiant-page/75699 "2006-11-12T14:25:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [November 12, 2006, 2:25pm UTC](https://www.ruby-forum.com/t/get-params-through-radiant-page/75699/1 "2006-11-12T14:25:48Z")

</div>

Hi guys,

It is possible to access GET parameters passed in the url of a Radiant  
page?

For example, I’m making a contact page, and instead of making multiple  
enquiry forms (sales, support, general, etc), it would be good if i  
could pass a url like ‘/contact/?type=sales’ and then programatically  
show different form fields depending on the type of enquiry…

If this is more of a ruby/rails level thing rather than a radiant  
thing, can i still do it from my radiant page?

Cheers,

Michael

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [November 12, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/get-params-through-radiant-page/75699/2 "2006-11-12T17:02:12Z")

</div>

thanks for the reply sean, i’ll have a think about your suggestion…

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [November 12, 2006, 2:31pm UTC](https://www.ruby-forum.com/t/get-params-through-radiant-page/75699/3 "2006-11-12T14:31:49Z")

</div>

Michael,

You can do it, but you’ll need a behavior. By default, all pages are  
cached and your page would not be able to respond to the GET  
parameters. Another option would be to create child pages of your  
“Contact” page called “sales”, “support”, or whatever. Then only the  
page that processes the submission of the form would need a behavior,  
and your contact pages wouldn’t need to respond to GET params.

Cheers,  
Sean C.  
[seancribbs.com](http://seancribbs.com)

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [November 12, 2006, 5:30pm UTC](https://www.ruby-forum.com/t/get-params-through-radiant-page/75699/4 "2006-11-12T17:30:17Z")

</div>

Hi Michael,

I experienced the same problem, here how I fixed it. I added below 3  
lines  
of code into models/page\_context.rb

# \<r:page:query\_string /\>

define\_tag ‘page:query\_string’ do | tag|  
tag.globals.page.request.parameters[‘q’] unless  
tag.globals.page.request.nil?  
end

As you can see, currently it returned only parameter q. I am not 100%  
finished with this, but it should be an easy fixed to get other  
parameters.  
Hopefully it gives you some idea.

This radius tag, so it would be global, and you can use it anywhere in  
the  
page.

Sean, I tried first to put into page parts and use custom behavior to  
extract the parameters object, but for some reason the request object is  
always nil at that level. I decided to modify radius instead and it  
worked.  
I am not sure why this happened.

Best,  
Leon Yeh  
New Avenue Systems Inc.  
Office: (626)254-1757 x880  
removed\_email\_address@domain.invalid  
Imagination Delivered. [www.newavenue.net](http://www.newavenue.net)

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [November 13, 2006, 12:27am UTC](https://www.ruby-forum.com/t/get-params-through-radiant-page/75699/5 "2006-11-13T00:27:38Z")

</div>

Thanks Leon, I might give that a try…
