In order to get your nested tags to render, you have to call
tag.expand. Like so:
tag 'cdate' do |tag|
d1 = tag.locals.d1 = Time.now
tag.locals.d3 = d1.strftime('%y%m%d%H%M%S')
tag.locals.d2 = d1.strftime('%y%m%d')
tag 'cdate:creation' do |tag|
tag 'cdate:transmission' do |tag|
tag 'cdate:transfer' do |tag|
Or are you trying to use Radius outside of Radiant? If so, what you
have should work, just make sure to call tag.expand and set tag.locals.
Shakthi Kannan wrote:
Is this the right place to ask questions about Radius tags?
I am still reading and trying to understand Radius tags. I have something like:
=== SNIPPET ===
context.define_tag 'cdate' do |tag|
d1 = Time.now
d3 = d1.strftime("%y%m%d%H%M%S")
d2 = d1.strftime("%y%m%d")
context.define_tag 'cdate:creation' do |tag|
context.define_tag 'cdate:transmission' do |tag|
context.define_tag 'cdate:transfer' do |tag|
print parser.parse('<r:cdate:creation />')
print parser.parse('<r:cdate:transmission />')
print parser.parse('<r:cdate:transfer />')
=== END ===
1. In all three print instances, whatever is returned from 'cdate'
definition alone is printed, even though I am using the nested tags.
For example, in the above, the value of 'd2' is printed in all three
instances. I am trying to define a general template, and based on
inputs, print the appropriate values.
2. 'creation' and 'transmission' tags return the same variable. How
can I define tags that perform the same functions, without having to
create separate definitions for each?
Appreciate any help in this regard,
Radiant mailing list