# Implementing a tag for outputting radiant tags?

**URL:** <https://www.ruby-forum.com/t/implementing-a-tag-for-outputting-radiant-tags/74721>\
**Category:** Radiant CMS\
**Created:** [November 7, 2006, 10:53am UTC](https://www.ruby-forum.com/t/implementing-a-tag-for-outputting-radiant-tags/74721 "2006-11-07T10:53:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![df-sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Post date:** [November 7, 2006, 10:53am UTC](https://www.ruby-forum.com/t/implementing-a-tag-for-outputting-radiant-tags/74721/1 "2006-11-07T10:53:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![df-sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Post date:** [November 7, 2006, 10:54am UTC](https://www.ruby-forum.com/t/implementing-a-tag-for-outputting-radiant-tags/74721/2 "2006-11-07T10:54:01Z")

</div>

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](http://wiseheartdesign.com)
