[Radiant] Re: if/unless. Proposal for a new conditional tag

2011-05-17 Thread eiked
Hi Andrew,

Thanks for pointing me to John Long's posting.

Obviously we got stuck at the very same point.

We're actually touching the core concepts and values of radiant here.

Up to this point radiant is a clever way of assembling html tags in a
very defined way.
That's the very beauty of radiant.

Should we really open radiant up to constructs of a programming
language?
We'd open up a pandoras box.

There's a real value in radiant,
that it does *not* provide for direct scripting.

We should keep this value.
Some people might oppose.

I suggest to invent conditionals into radiant,
based on a very restricted context.

I believe such things can be done with in ruby.
That would be like an internal sandbox.




















On 8 Mai, 16:19, Andrew Neil  wrote:
> That's a good idea, and I agree that it would be an improvement. John
> Long made a similar proposal on his blog a while back:
>
>    http://wiseheartdesign.com/articles/2010/03/11/proposal-generic-condi...
>
> I don't know whether the proposal has been implemented, but perhaps
> someone else on the list could say.
>
> Cheers,
> Drew
>
>
>
> On Thu, May 5, 2011 at 11:23 PM, eiked  wrote:
> > I'd like to propose an improvement to the way radiant handles
> > conditionals.
>
> > Currently we have a lot of diverse  and corresponding
> >  tags.
>
> > I'd like to make a proposal how this can be improved.
>
> > The first step would be to consolidate if/else into a container like:
> > 
> >  render something if the condition is true
> >  render something else if the condition is false
> > 
>
> > The next step would be to unify the conditons:
>
> > 
> >  render something if the condition is true
> >  render something else if the condition is false
> > 
>
> > So we need to come up with some expression language to formulate those
> > conditions.
>
> > Maybe something like:
> >    
> > instead of 
>
> > You get the idea.


[Radiant] Re: if/unless. Proposal for a new conditional tag

2011-05-08 Thread eiked
Hi Shanison, hi Andrew,

There are two roads here towards the condition expressions.
Either we make it specific to radiant and limited.
or we go full throttle and open it up to all of ruby.

I'd suggest that we make this a domain specific language first.
Giving only very limited access to the context.

So what's the root object in a page context?
What's the root object in a snippet context?

It should be quite easy.












[Radiant] Re: if/unless. Proposal for a new conditional tag

2011-05-05 Thread Shanison
Current Radius tag design has determined that it can't use radius tag as 
attribute for radius tag. And the if else combination would add more 
complexity to the parsing of the Radius tag, which I feel that it may affect 
the performance issue.