On 14/09/06, Sean Cribbs <[EMAIL PROTECTED]> wrote:
> I've been following this thread, but haven't replied yet.  The problem may
> be a tag scoping issue, and maybe a custom tag is in need here.
>
> tag "children:random" do |tag|
>   children = tag.locals.children
>   if children.size > 0
>     index = rand(children.size)
>     tag.locals.page = children[index]
>     tag.expand
>   end
> end
>
> Then in your page, write
>
> <r:children:random /><r:title /></r:children:random>
>
> or just
> <r:children:random:title />
>
> This will only select one child page, mind you, and would need to be
> modified to select more than one.

I've added this to the wiki at
http://dev.radiantcms.org/radiant/wiki/HowToDefineGlobalTags

-- 
Regards,
Dave
_______________________________________________
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to