Accessing params[] inside a tag

Hi.
I am developing a family of tags that should do the following:

  • find_by_id a given record for a Model in the database
    -show field values for that record
    This tags are defined in a Model which inherits from Page

This tag should work inside a radiant page called through a normal
SiteController#show_page action.
I pass the id for the record to be found as a param in the GET request.
I
obtain the following log:

Processing SiteController#show_page (for 127.0.0.1 at 2007-05-16
06:06:03)
[GET]
Parameters: {“url”=>"/en/links/singlelink", “action”=>“show_page”,
“id”=>“22”,
“controller”=>“site”}

The problem is that I cannot find a way to retrieve the value of the
‘id’
param in the code for tags which are placed in the called page.
I have tried the following (without success)
curId = params[:id]
curId = tag.locals.params[:id]
curId = tag.globals.params[:id]
curId = tag.locals.page.params[:id]

Am I missing a gotcha?
Thanks in advance for any hint

Luca Erzegovesi
[email protected]

The problem is that I cannot find a way to retrieve the value
of the ‘id’
param in the code for tags which are placed in the called page.
I have tried the following (without success)
curId = params[:id]
curId = tag.locals.params[:id]
curId = tag.globals.params[:id]
curId = tag.locals.page.params[:id]

tag.globals.page.request.params[:id]

Luca,

I have developed an extension that allows for the looking up of records
and the displaying of field info. I haven’t packaged it and made it
available as of yet since I still wanted to add a few more features and
clean it up; however, you’re welcome to it.

If you’re interested, just let me know.
Mario

mlanza …AT… comcast …DOT… net

Hi Mario,

Could I also get a copy of your extension?

Thanks,
saji

mlanza …AT… comcast …DOT… net


Posted via http://www.ruby-forum.com/.


Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [email protected]
KOREA

I have made my extension available. See:
http://www.ruby-forum.com/topic/108491#247243

Hi Mario,

Could I also get a copy of your extension?

Thanks,
saji

mlanza …AT… comcast …DOT… net


Posted via http://www.ruby-forum.com/.


Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [email protected]
KOREA

Hello,

I am trying out the “How To” by Sean C. on how to create global
tags in a plugin.
When I try to run the command:

ruby script/generate plugin 00_mytags

I get the message :

Couldn’t find ‘plugin’ generator

What could be wrong?

Thanks,
saji

This is an old tutorial. The use of plugins for global tags has been
deprecated and replaced with extensions. You will want to run “ruby
scipt/generate extension my_extension_name” instead. Essentially, you
will need to put the new tags in the lib folder (or model folder) of
the extension, which is essentially a mini rails app.

Take a look at the example extensions in the repository for hints on
how to make global tags. John is working on a tutorial and posted a
draft of it a few days back. It isn’t done yet, but has lots of great
information. Dig through the archives, it wasn’t more than a week ago.

Keith B.
[email protected]
Tel: +49-7731-7983830

Keith, David:

Thank you very much. I am happily able to extend the tags now.
Thanks to Sean C. for the dynamic navigation tags (dug up from
the mailing list archive) which was the one I wanted to implement.

saji

On May 20, 2007, at 4:54 AM, Keith B. wrote:

Dig through the archives, it wasn’t more than a week ago.

May 16 and the subject of the thread was: Creating extension

You mean the sitemapper? Either way, you’re welcome; pay it forward.

Sean

Sean,
I meant the “if_ancestor_or_self” tag.

    tag "if_ancestor_or_self" do |tag|
            tag.expand if (tag.globals.actual_page.ancestors +

[tag.globals.actual_page]).include?(tag.locals.page)

saji

how to make global tags. John is working on a tutorial and posted a

Couldn’t find ‘plugin’ generator
Search: http://radiantcms.org/mailing-list/search/
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [email protected]
KOREA