I love the idea you've got going here. I haven't had a chance to try it but I have a few thoughts:

While the proliferation of tags can be bad for users, Radiant lacks any mechanism for ensuring dependancies are installed making using this extension within my own potentially destabilizes my extension. This is a sufficiently fundamental thing that I'd be happier to see it rolled into the core than distributed as an extension. The examples in the readme all refer to things that are properties of the page. It would be useful to better explain how something other than the property of a page can be referred to.

As an aside, I think that there is a place for purpose specific conditional tags. Personally I'm not convinced that

<r: if cond="content['body'] exists?"> blah </r:if>

is more readable than

<r:if_content />

to someone who isn't already a developer of some sort who understands what a conditional is.

For example, I use Radiant for websites for a website that is managed by a bunch of grey haired folk who think about authoring for the web as a page was a piece of paper they put in their typewriter (figuratively, fortunately). Radiant is a great tool for these sorts of people, who legitimately need a good website but shouldn't have to pay me to $100/hr to type in their content. I've shown them how to create pages and write using Textile (which is nearly perfect for this... unless I can ben one of the WYSIWIG plug-ins to my will). Tags are not for them (fortunately). If these folk ever write any sort of tag, after I pick myself off the floor I'll have to go ask them what they're doing and try to do it "properly".

There are other classes of user between them and extension authors (notably people who are not developers by trade but are hacking with radiant to get things done) for whom purpose specific tags, while limiting, can be a great aid to doing useful and interesting things. I think that there is a place for these tags and I'd love it if there was an easy way to use this to create both if_ and unless_ tags. Something like:

conditional_tags "my_tag" do |tag|
  #return a boolean

which would then create if_my_tag and unless_my_tag tags. For the if_ tag, the contents of the tag is executed when block returns true, and the reverse happens for the unless_ tag.

This syntax combined with your generic tags would probably provide the right level of excellence for all classes of user.

Now all we need is to simplify looping, another common tag type that could be simplified for extension authors.


On 23-Oct-08, at 9:55 AM, Chris Parrish wrote:

Hello all. I'm finally releasing an extension that I've mentioned over the last year on the list. I think that it has a lot of power and potential but I could use some input from the Radiant clan.

The Conditional Tags Extension ( ) creates <r:if> and <r:unless> tags that allow for flexible (and customizable) conditions. Start with the README there -- it covers what I'm thinking and a lot of what this thing can do.

I want this extension to be very easy to use for users (read: non- developers) and also helpful to developers (I wrote it so that your extensions can plug into the conditionals framework to easily add your own values). Please help me make this one as useful as possible.


BTW, I apologize if this ends up being a double post. I think I goofed something up when I sent it last night so I wanted to make sure...
Radiant mailing list

Radiant mailing list

Reply via email to