How to use Google Blogger Lambda Operators

Love <[email protected]> Sun, 7 Jan 2018 20:10:01 -0800 (PST)
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>
Google Blogger has implemented a new set of Lambda expression operators for 
its template language. See: 
https://blogger.googleblog.com/2016/05/more-custom-template-flexibility.html
 and https://productforums.google.com/forum/#!topic/blogger/l3phi8bscGY .

The example code given (the b:if/ amended) is:

<!-- Show a Flower image if the post has the label flower -->
<b:if cond='data:post.labels any (l => l.name == "Flower")'>
  <img src=’/img/flower.jpg’ />
</b:if>

I can't figure out how to get this to work in a template. Would someone 
please provide some working code I could drop in to a template and see it 
working.


Here is my code (A):

================
 <b:section class='main' id='blog-posts' name='Main' showaddelement='no'>
            <b:widget id='HTML10' locked='false' title='Test1234' 
type='HTML' version='1'>
              <b:widget-settings>
                <b:widget-setting name='content'>hello</b:widget-setting>
              </b:widget-settings>
              <b:includable id='main'>
 

* <b:if cond='data:post.labels any (l => l.name <http://l.name/> == 
"Flower")'> *
*  Hi!*
*</b:if>*
            
  <!-- only display title if it's non-empty -->
  <b:if cond='data:title != &quot;&quot;'>
    <h2 class='title'><data:title/></h2>
  </b:if>
  <div class='widget-content'>
    <data:content/>
  </div>

  <b:include name='quickedit'/>     
</b:includable>
            </b:widget>



=============

Actually I wish the widget shows according my post label , flower widget 
show when it's a flower post, computer widget show when it's a  
computer  post, I've this thought:


================
 <b:section class='main' id='blog-posts' name='Main' showaddelement='no'>
            <b:widget id='HTML10' locked='false' title='Test1234' 
type='HTML' version='1'>
              <b:widget-settings>
                <b:widget-setting name='content'>hello</b:widget-setting>
              </b:widget-settings>
              <b:includable id='main'>
 

* <b:if cond='data:post.labels any (l => l.name <http://l.name/> == 
"Flower")'> *


            
  <!-- only display title if it's non-empty -->
  <b:if cond='data:title != &quot;&quot;'>
    <h2 class='title'><data:title/></h2>
  </b:if>
  <div class='widget-content'>
    <data:content/>
  </div>

  <b:include name='quickedit'/>   *</b:if>*  
</b:includable>
            </b:widget>


========


Regrettable,  even if I use my first code (A), still not working. I wonder 
this method really works or what setting wrong I've made that cause this. I 
tired other blogger template but have a same result.

-- 
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.