I’m trying to process one radius tag inside another. For example, one
tag retrieves a photo name such as “Dave.jpg” and sticks it into the
page_attachments tag for an image:
This fails because Radius can’t parse tags that are within attributes.
Why are you trying to do this? Is there a way to accomplish what you
want without using tags within attributes.
This fails because Radius can’t parse tags that are within attributes.
Why are you trying to do this? Is there a way to accomplish what you
want without using tags within attributes.
My goal was to have a person’s name in the DB generate a filename that I
could pass to the page_attachments tag to grab. Example:
David P. → david_piehler.jpg → <r:attachment:image
name=“david_piehler.jpg” />
As you’ve said though, something like this is not possible due to the
way Radius tags are parsed. Thanks for clarifying this. I’ve since taken
a more heavy-handed approach to solve it.
My goal was to have a person’s name in the DB generate a filename that I
could pass to the page_attachments tag to grab. Example:
David P. -> david_piehler.jpg -> <r:attachment:image
name=“david_piehler.jpg” />
As you’ve said though, something like this is not possible due to the
way Radius tags are parsed. Thanks for clarifying this. I’ve since taken
a more heavy-handed approach to solve it.
David,
The way I’ve found to do this is to use nested Radius tags that pass
information back up to the parent. However, the page_attachments tags
are currently not structured to support this. If they were, it might
look like this:
I don’t see why you couldn’t override <r:attachment:image> with your own
custom version that would permit either a ‘name’ or ‘user_name’
attribute like:
<r:attachment:image user_name=“David P.” />
Of course you’d have the issue of keeping your version of the tag in
sync with revisions to the PageAttachments extension. But it would
probably be pretty easy to implement too.
I don’t see why you couldn’t override <r:attachment:image> with your own
custom version that would permit either a ‘name’ or ‘user_name’
attribute like:
<r:attachment:image user_name=“David P.” />
Of course you’d have the issue of keeping your version of the tag in
sync with revisions to the PageAttachments extension. But it would
probably be pretty easy to implement too.
-Chris
That’s a good idea. If my temporary solution doesn’t work out, I’ll try
that. Thanks!
Dave
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.