Andrew Neil wrote:
> Currently, there is no tag equivalent to <r:has_child>, as far as I  
> know. There are tags <r:parent /> and <r:unless_parent />. If such a  
> tag was to be created, it would probably be useful to create its  
> opposite as well, e.g <r:has_no_child> or <r:childless>. (Any  
> thoughts as to how the pair of tags should be named?)
>   
A while back I mocked up an extension that abstracted conditionals.  I 
like having a test for children as Andrew suggests but does anyone else 
think it would be useful to have a general <r:if> radius tag so that 
things like this could be added without cluttering up the number and 
variety of default if_tags out there?

So instead of:
  <r:if_parent>
  <r:if_content>
  <r:if_children>
  <r:if_next_great_idea>

you'd have something like:
  <r:if cond="parent"> or, maybe <r:if cond="page.parent exists?">
  <r:if cond="parts">
  <r:if cond="children">

It's not my suggested syntax that I'm so concerned about here as the 
concept of keeping all the <r:if_stuff> code DRY and reducing the number 
and complexity of all the different tags for the user.  I'm guessing 
that this won't be the last conditional radiant adds.


Oh, and to answer your question Andrew.  I think that existence-test 
tags in radius are usually named like:
  <r:if_children> and <r:unless_children> or,
  <r:if_child> and <r:unless_child>

Of course you could also go with the King James Translation:
  <r:if_withchild> and <r:if_barren>  :)


-Chris

_______________________________________________
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