Re: [Radiant] using CGI parameters

2010-01-07 Thread Jim Gay

On Oct 22, 2009, at 6:52 AM, Anton Aylward wrote:

> Mamed Mamedov said the following on 10/22/2009 01:31 AM:
>> As i know you can access query params via params hash. For example,
>> http://yoursite.com/?someparam=123 will be accessable through:
>> params[:someparam]
>> 
>> Is it ok?
> 
> Not really.
> I know about that in RoR /app/ files, code and views and templates,
> but what I'm dealing with here are Radiant pages.
> 
> I didn't think the 'raw' RoR level was accessible.
> Why else have the radius language?
> 

I had this thread set aside to reply a while ago and forgot about it.
You'll need to turn caching off for the page type you are using.
I've seen some code out there where developers just turn off caching for the 
entire site. Radiant::Cache is great; use it; don't turn off the cache for the 
entire site unless you have some truly compelling reason to do so.

Something like this might work:

class MyPage < Page
  include Radiant::Taggable

  def cache?
false
  end

  tag 'my_param' do |tag|
request.parameters['my_param']
  end

end


Then on a MyPage you can can use  to output that param value. Or 
do something valuable with it.

Jim Gay
http://www.saturnflyer.com




___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] using CGI parameters

2009-10-22 Thread Anton Aylward
Mamed Mamedov said the following on 10/22/2009 01:31 AM:
> As i know you can access query params via params hash. For example,
> http://yoursite.com/?someparam=123 will be accessable through:
> params[:someparam]
> 
> Is it ok?

Not really.
I know about that in RoR /app/ files, code and views and templates,
but what I'm dealing with here are Radiant pages.

I didn't think the 'raw' RoR level was accessible.
Why else have the radius language?


-- 
History knows no resting places and no plateaus.
-- Henry Kissinger
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] using CGI parameters

2009-10-21 Thread Mamed Mamedov
As i know you can access query params via params hash. For example,
http://yoursite.com/?someparam=123 will be accessable through:
params[:someparam]

Is it ok?

On 10/22/09, Anton Aylward  wrote:
> I have a Radiant site hosted on Dreamhost.
> It works fine.
>
> I'm in the process of adding their "Announcement List" to the site.
> OK so far.
>
> Their how-to page is at
> http://wiki.dreamhost.com/Announcement_Mailing_List#How_do_I_display_information_from_the_form_on_my_custom_URLs.3F
> Well, actually that's my question.
>
> They give an example in PHP of taking CGI parameters and using hem in
> the text body of the page.
>
>  $email = $_GET['address'];
>   $name = $_GET['name'];
>   ?>
>   Thanks for subscribing,  - we'll send our
>   next newsletter to you at !
>
>
> Can you do this in Radiant?
>
> Actually there also the 'code' parameter.
> it would be nice to be able to have just one response page and to be
> able to branch on that code.  Is this do-able in Radiant?
>
> /a
>
>
> ___
> Radiant mailing list
> Post:   Radiant@radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>

-- 
Sent from my mobile device


Regards,
Mamed Mamedov
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] using CGI parameters

2009-10-21 Thread Anton Aylward
I have a Radiant site hosted on Dreamhost.
It works fine.

I'm in the process of adding their "Announcement List" to the site.
OK so far.

Their how-to page is at
http://wiki.dreamhost.com/Announcement_Mailing_List#How_do_I_display_information_from_the_form_on_my_custom_URLs.3F
Well, actually that's my question.

They give an example in PHP of taking CGI parameters and using hem in
the text body of the page.


Thanks for subscribing,  - we'll send our
next newsletter to you at !


Can you do this in Radiant?

Actually there also the 'code' parameter.
it would be nice to be able to have just one response page and to be
able to branch on that code.  Is this do-able in Radiant?

/a


___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant