[Radiant] How to get the content ID from the database?

Sean Cribbs seancribbs at gmail.com
Tue Mar 11 09:16:33 CDT 2008


Alternatively, you can add this tag definition:

Page.class_eval do
  tag "id" do |tag|
    tag.locals.page.id
  end
end

You would need to add this in an extension or (less desirably) in 
config/environment.rb.

Sean

Mārtiņš Grunskis wrote:
> Hi,
>
> Meybe you can use child <r:slug /> instead of ID? Slug is unique and
> that's all what is needed AFAIK.
>
> Regards,
> Martins
>
> On 3/11/08, rainer griess <mynewnews at gmx.net> wrote:
>   
>> Hi again,
>>
>>  I asked about something similar in the AJAX Interaction thread. But I
>>  would like to make the question simler:
>>
>>  How can I get the child ID of the child within an <r:children:each>
>>  loop?
>>
>>  I have to use the ID to define some CSS classes on the fly and
>>  therefore I need a unique name.
>>
>>  Any ideas?
>>
>>  Thanks your,
>>  rainer
>>  _______________________________________________
>>  Radiant mailing list
>>  Post:   Radiant at radiantcms.org
>>  Search: http://radiantcms.org/mailing-list/search/
>>  Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>>
>>     
> _______________________________________________
> Radiant mailing list
> Post:   Radiant at radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
>   



More information about the Radiant mailing list