Implementing a tag for outputting radiant tags?

So I’ve put together a couple of plugins for Radiant, which plugins
provide some global tags. Now I’d like to write about these tags on
my Radiant-powered web site.

That is, I’d like to be able to write something like:

<pre><code><r:blah foo="bar"><r:link/></r:blah></code></pre>

without the <r:blah> tag being executed and replaced by its output.
The <r:escape> tag doesn’t help, since the <r:blah> tag gets expanded
first, then its output is escaped.

I was thinking of creating a simple “echo” tag, like

Behavior::Base.define_tags do
tag “echo” do |tag|
tag.contents
end
end

but obviously there’s no “contents” property (or “body” or “text” or
any other variation I could think of). I’ve looked through radius.rb,
and page_context.rb, but don’t see a way.

If someone could point me in the right direction, I’m happy to do the
work. I just don’t know where to start . . .

  • Sean

Sean S. wrote:

That is, I’d like to be able to write something like:

If someone could point me in the right direction, I’m happy to do the
work. I just don’t know where to start . . .

Unfortunately I don’t know of an easy way to make this happen. I’ve
consider providing an escaping mechanism to Radius so that you could
write:

<r:tag_name />

But I haven’t had the time to mess with it. For now I’d suggest that you
write your tags with the > and < entities:

<r:tag_name />


John L.
http://wiseheartdesign.com