Categories > TinyButStrong general >

crazy syntax -- how to block conditional?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: tim
Date: 2009-05-06
Time: 02:12

crazy syntax -- how to block conditional?

I was excited to find TBS when you mentioned the raw tpls  were html compatible.. .but i have to say, im not a complete idiot but the syntax you guys chose is really complicated. All I need are some basic conditionals and I spent 40 minutes and still cant figure out how these conditional blocks work the way i want them to. 
your examples show the onload method or something, but you also say you can name the blocks... which i dont get why.

why wont this work?

[blk1;block=begin; when [var.something]=1]
something
[blk1;block=end]

when i load the template and show it, the template code shows up??
do i have to do a mergeblock() just to do a simple conditional?


By: Skrol29
Date: 2009-05-06
Time: 09:34

Re: crazy syntax -- how to block conditional?

Hi Tim,

Only [onload], [onshow] and [var] are automatics.
Other blocks or fields must be explicitly merged using MergeBlock() or MergeField().

Your snippet can work automatically if you code it like this:
[onload;block=begin; when [var.something]=1]
something
[onload;block=end]