More Info:
JavaScript Comparison and Logical Operators
http://www.w3schools.com/JS/js_comparisons.asp
Blogger Help: Widget Tags for Layouts
http://www.google.com/support/blogger/bin/answer.py?hl=en&answer=46995
Test 1
<b:if cond="data:blog.searchQuery != "" ||
data:blog.searchQuery == "TOAST"">
<!--not equal null or equal TOAST-->
</b:if>
Result
Uploaded fine but I get this error on my pages
TEMPLATE ERROR: Extra characters at end of string: buf=[||]
remainder=[data:blog.searchQuery == "TOAST"]
Test 2
<b:if cond="data:blog.searchQuery || data:blog.title">
<!--data:blog.searchQuery or data:blog.title-->
</b:if>
Result
TEMPLATE ERROR: Extra characters at end of string: buf=[||]
remainder=[data:blog.title]
I tried it again with && but got the same error except with
"buf=[&&]".
I'm really hoping I just did something wrong. :) Just imagine how but
be if we went from this:
<b:if cond="data:a">
<b:if cond="data:b">
<b:if cond="data:c">
<b:if cond="data:d">
*stuff*
</b:if>
</b:if>
</b:if>
</b:if>
TO THIS!!!
<b:if cond="data:a && data:b && data:c &&
data:d">
*stuff*
</b:if>
That's not even an exaggerated example. Well, my fingers are crossed.
On Mar 26, 7:36 pm, Alain-Christian <mynamebackwa...@gmail.com> wrote:
> Please say yes! Oh man, life would be so much easier. Sometimes I get
> lost with all those nested Comparison Operators. Commenting helps me
> keep track things but things don't always work out as expected.
>
> More Info:
> JavaScript Comparison and Logical Operatorshttp://www.w3schools.com/JS/js_comparisons.asp
Thanks for the great suggestion!
We would also love to add those operators like &&, ||, etc. But our
current implementation of the template parser is a pretty simple one,
and adding those would be quite a lot of work. It's definitely on our
TODO list. And we keep on improving our template markup language. For
example, we recently added the "modulo" operator (%) to the supported
operators (previously only + and - were supported). Please stay tuned
until our higher priority tasks are complete :)
Jinwoo
> It's definitely on our TODO list.
OH MY GOD.
> And we keep on improving our template markup language.
!!!!!
This is AMAZING news! Sure, take care of the other stuff first, that's
cool. You're spinning a lot of plates right now. The fact that you've
already been thinking about it and that it's on the list is just about
the greatest thing ever. I can't wait, it's totally going to be worth
it.
> For example, we recently added the "modulo" operator (%) to the supported operators (previously only + and - were supported).
I'm sorry, I don't understand. How do I use %, + and - in conditional
statements? I've never heard of modulo before and I'd be willing to
research its usage in my own time. I need to know how to format it
though. Same with - and +.
Thank you.
To unsubscribe from this group, send email to blogger-template-design+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
On Mar 28, 2:05 am, Jinwoo Lee <jin...@google.com> wrote:
> Thank you, Alain.
>
> Using % will be best described by an example code. It may be useful when you
> want to do something for every N-th loop. For example, if you want to show
> the labels on your blog post and show 3 labels on each line, you can do like
> this:
>
> <b:loop values='data:post.labels var='label' index='idx'>
> <data:label.name/>
> <b:if cond='data:idx % 3 == 2'><br/></b:if>
> </b:loop>
>
> This code puts <br/> for every 3rd label. The "index" variable of the loop
> starts from zero and is incremented for each loop (0, 1, 2, ...). So every
> 3rd index modulo 3 becomes 2. The "index" variable of the loop was also
> recently added to our markup language.
>
> Hope this will be useful.
>
> Thanks,
> Jinwoo
>
> On Sat, Mar 27, 2010 at 9:44 PM, Alain-Christian
> <mynamebackwa...@gmail.com>wrote: