> In order to let my users be able to use radius
    > tags in the "body" field of my event in a similar manner as the body
    > field of a page, I need to have some way of parsing the body text.

     You don't need to do any parsing.  If you expand the <r:event:body>
tag, Radius will take care of rendering whatever is inside, including any
other tag.  Then you get the result in the <r:event> tag and do whatever you
want.

     This will not work if you want some kind of fine control on how the
tags inside <r:event:body> expand, but as i understand this is not what you
are looking for.

     Take a look to the code of the <children:each> tag for an example of
expanding the tag and accumulating the result:


http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/standard_tags.rb#L88

     <random> is also nice simple example:


http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/standard_tags.rb#L431

      /AITOR

On 8/22/07, Steve Erickson <[EMAIL PROTECTED]> wrote:
>
> Thanks Aitor.  I probably wasn't very clear in my first post.  Sorry
> about that.  Let me see if I can explain it again.
>
> I already have <r:event></r:event>, <r:event:date format="" />,
> <r:event:title />, <r:event:body />.  The problem is that the text in my
> body tag also contains radius content.  For example, I wanted to define
> a radius tag for creating links, or creating an inline google map or
> some simple formatting.  In order to let my users be able to use radius
> tags in the "body" field of my event in a similar manner as the body
> field of a page, I need to have some way of parsing the body text.  One
> of the things I was considering doing was just creating my own radius
> context and parser.  The body tag definition would then look something
> like the following (psuedo-code)
>
> tag "event:body" do |tag|
>   context = Radius::Context.new()
>   parser = Radius::Parser(context, :tag_prefix => 'r')
>   #some code to define tags
>   parser.parse(tag.locals.event.body)
> end
>
> I was trying to avoid creating my own context and parser and instead use
> the already existing one that Radiant uses.  that would I wouldn't have
> to figure out how to redefine all of the existing page tags, but maybe
> I'll just end up going down that route.
>
> Steve
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to