[Radiant] check for children

Sean Cribbs seancribbs at gmail.com
Sun Sep 24 11:49:53 CDT 2006


Dave Crossland wrote:
> On 24/09/06, Steven Noels <stevenn at outerthought.org> wrote:
>   
>> In my base template, I want to output a <div> only if some children
>> of the current page exist. How can I check for children of a page?
>>     
>
> You need to define a new tag like <r:if_children> that would work like this:
>
> <ul>
>   <r:children:each by="title" order="asc">
>   <li><r:link /></li>
>   </r:children:each>
> </ul>
> </r:if_children>
>
> This is explained in more details on the wiki - to which I hope you'll
> contribute your experiences with! :-)
>
> http://dev.radiantcms.org/radiant/wiki/HowToDefineGlobalTags
>
>
>   
Perhaps, but the children:each tag will only work if children exist.  So 
in a sense it encapsulates the if_children idea.  If you give us a 
little more context or detail, I might be able to come up with some code 
that will do the trick.

Sean Cribbs
seancribbs.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20060924/fcaa2c63/attachment.html


More information about the Radiant mailing list